2012-04-30 51 views

回答

1

This鏈接應該有你需要的。但是,您是否將該鏈接作爲文件下載到您的應用程序目錄中?如果是這樣,進口parseCSV後,是相當容易去通過CSV文件的行:

CSVParser *parser = [CSVParser new]; 
NSString *csvFilePath = [[NSBundle mainBundle] pathForResource:@"myCsvFile" ofType:@"csv"]; 
[parser openFile:csvFilePath]; 
NSArray *csvContentArray = [parser parseFile]; 

for (int i=0; i<csvContentArray.count; i++) 
    NSLog(@"parsed %d %@", i, [csvContentArray objectAtIndex:i]); 

[parser closeFile];