How to get file path in iPhone app

后端 未结 5 2288
独厮守ぢ
独厮守ぢ 2020-12-12 22:22

I have a problem accessing my files in my app.

I am currently using

//Directly from TileMap example from WWDC2010
NSString *tileDirectory = [[[NSBun         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 23:05

    You need to use the URL for the link, such as this:

    NSURL *path = [[NSBundle mainBundle] URLForResource:@"imagename" withExtension:@"jpg"];
    

    It will give you a proper URL ref.

提交回复
热议问题