The physical path for my files in the Xcode Resources folder (for IOS)

I am developing an application for the iPad. I want to access a text file in the Resources folder! I do it as follows:

 NSString* filePath = @"/Users/net4uonline/Desktop/slots2/paylines.txt";

Now, if I transfer the entire project from the desktop to another, I know that this will not work. So, is there a way to give a relative path for this file instead of the current path. Maybe as follows?

NSString* filePath = @"Resources/paylines.txt";

I know this will not work, but since my file will always be inside the Resources folder, I thought it might work!

+3
source share
1 answer

I think you are looking for an NSBundle and pathForResource: ofType: method , aren't you?

+5
source