Skip to content

Instantly share code, notes, and snippets.

@rraallvv
Created June 13, 2012 03:40
Show Gist options
  • Save rraallvv/2921697 to your computer and use it in GitHub Desktop.
Save rraallvv/2921697 to your computer and use it in GitHub Desktop.
Read a File From Cocoa Application Bundle
// How To Read a File From Your Application Bundle
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"MyFile" ofType:@"txt"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
if (myData) {
// do something useful
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment