NSString *fileContent= [NSString stringWithContentsOfFile:filepath];
NSArray *lines= [fileContent componentsSeparatedByString:@"\n"];
NSArray *lines= [fileContent componentsSeparatedByString:@"\n"];
int i, c= [lines count];
for(i= 0; i<c; i++) {
NSString *line= [lines objectAtIndex:i];
...
}
forでなくwhileが好きならこんな感じ…なのか?
NSEnumerator *lineEnum= [lines objectEnumerator];
NSString *line= nil;
while(line= [lineEnum nextObject]) {
...
}
うー.
0 件のコメント:
コメントを投稿