How to get file path in iPhone app

后端 未结 5 2287
独厮守ぢ
独厮守ぢ 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 22:51

    Since it is your files in your app bundle, I think you can use pathForResource:ofType: to get the full pathname of your file.

    Here is an example:

    NSString* filePath = [[NSBundle mainBundle] pathForResource:@"your_file_name" 
                                                ofType:@"the_file_extension"];
    

提交回复
热议问题