Want more features on Pastebin? Sign Up, it's FREE!
Guest

StackOverflow Question 14360930

By: a guest on Jan 16th, 2013  |  syntax: Objective C  |  size: 0.26 KB  |  views: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. NSString *filePath = @"/path/to/file.txt";
  2. NSString *myFile = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
  3. NSArray *items = [myFile componentsSeparatedByString:@"\n"];
  4.    
  5. [labelOne setStringValue:[items objectAtIndex:0]];
clone this paste RAW Paste Data