Bundle pathForResource方法返回nil问题

2017-11-01  本文已影响0人  曾柏超

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)



WechatIMG18 1.jpeg
上一篇 下一篇

猜你喜欢

热点阅读