the physical path for my files inside the Resources folder of XCode (for IOS)
I'm developing an application for iPad. I want to access a text file inside the Resources folder! I'm doing that in following way:
NS开发者_高级运维String* filePath = @"/Users/net4uonline/Desktop/slots2/paylines.txt";
Now, if I move my whole project from Desktop to somewhere else I know this won't work. So, is there any way to give a relative path for this file instead of the current path. Maybe like the following?
NSString* filePath = @"Resources/paylines.txt";
I know this won't work but as my file is always going to reside inside the Resources folder, so I thought this might work!
I guess you are looking for NSBundle and pathForResource:ofType: method, aren't you?
精彩评论