Tag: iOSSDK/ファイルIO
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"csv"]; NSString *text = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; NSArray *lines = [text componentsSeparatedByString:@"\n"]; NSLog(@"line count: %d", lines.count); for (NSString *row in lines) { NSArray *values = [row componentsSeparatedByString:@","]; NSLog(@"value count: %d", values.count); }