Tuesday, 10 January 2012

get file from resources folder

If you considered tamil.txt file exist in resources folder you want to get the content of file.
step 1:
         First get the file path from resources folder

 NSString *path=[[NSBundle mainBundle] pathForResource:@"tamil.txt" ofType:nil];

Step 2:
      Then get content from path
  NSString *Content=[NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSLog(@"content===%@",Content);  

No comments:

Post a Comment