Last active
August 29, 2015 14:01
-
-
Save moc0311/03e6978c2eaa4395816d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//可変配列を用意 | |
NSMutableArray *words = [NSMutableArray array]; | |
NSError *error; | |
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"wordList" ofType:@"txt"]; | |
NSString *content = [NSString stringWithContentsOfFile:filePath | |
encoding:NSUTF8StringEncoding | |
error:&error]; | |
for (NSString *line in [content componentsSeparatedByString:@"\n"]) { | |
[words addObject:line]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment