Advertisement
Guest User

Untitled

a guest
Sep 14th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. - (NSMutableArray *)createDictionary
  2. {
  3.  
  4. NSMutableArray *dictionary = [[NSMutableArray alloc] init];
  5.  
  6. NSArray *fileNames = @[@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z"];
  7.  
  8. for(int c = 0; c < fileNames.length; c++) {
  9. NSString *path = [[NSBundle mainBundle] pathForResource:fileNames[c] ofType:@".txt"];
  10. NSString *input = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL];
  11.  
  12. for (NSString *line in [input componentsSeparatedByString:@"n"]) {
  13. [dictionary addObject:line];
  14. }
  15. }
  16. return dictionary;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement