URLForResource:withExtension: method always returns nil
I am testing the MixerHost sample code. However the following code: NSURL *beatsLoop = [[NSBundle开发者_如何学C mainBundle] URLForResource: @"beatsMono" withExtension: @"caf"]; the beatsLoop is nil.
What's the reason for that? Should I first create the beatsMono.caf file and then put into some specific path?
Any comments and solutions will be highly appreciated.
Thanks, finspoo
Should I first create the beatsMono.caf file and then put into some specific path?
Yes. The file beatsMono.caf (case sensitive!) must exist in your application bundle for that method to succeed. This is done by adding the file to the target as a resource in XCode, you cannot do it at runtime.
精彩评论