NSError *errorFileReading;
//Read file from mainBundle
NSString *strFileContent = [NSString stringWithContentsOfFile:[[NSBundle mainBundle]
pathForResource: @"fileName" ofType: @"txt"] encoding:NSUTF8StringEncoding
error:&errorFileReading];
if(errorFileReading) { //Handle error
NSLog(@"errorFileReading");
}
if (strFileContent) {
//Handle file content over here
}
No comments:
Post a Comment