Created
June 13, 2012 03:40
-
-
Save rraallvv/2921697 to your computer and use it in GitHub Desktop.
Read a File From Cocoa Application Bundle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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