Return to Snippet

Revision: 26911
at May 16, 2010 07:56 by giftederic


Updated Code
// Read in and store as stringNSString*file =[[NSBundle mainBundle] pathForResource:@"jsonTest" ofType:@"txt"];
NSString*str =[NSString stringWithContentsOfFile:file 
   encoding:NSUTF8StringEncoding error:NULL];
debug(@"str: %@", str);
 
// Do something with the test data...
 
// Read in and store as raw data bytesNSString*file2 =[[NSBundle mainBundle] pathForResource:@"data" ofType:@"txt"];
NSData*data =[NSData dataWithContentsOfFile:file2];

Revision: 26910
at May 16, 2010 07:55 by giftederic


Initial Code


Initial URL


Initial Description


Initial Title
Read Files from the Application Bundle

Initial Tags
textmate

Initial Language
Objective C