Bundle pathForResource方法返回nil问题


oc:
    NSString* soundPath = [[NSBundle mainBundle] pathForResource:@"in" ofType:@"caf"]; 
    NSLog(@"soundPath:%@", soundPath); 

swift 3.0:
    let audioFile = Bundle.main.path(forResource: "in.m4a", ofType: nil)
    print(audioFile)



Bundle pathForResource方法返回nil问题_第1张图片
WechatIMG18 1.jpeg

你可能感兴趣的:(Bundle pathForResource方法返回nil问题)