0
我想通过实时链接解析csv数据并将其转换为NSMutabledictionary.Here是我用于csv文件的链接。如何将csv文件数据转换为NSMutabledictionary
http://ichart.yahoo.com/table.csv?s=BAS.DE&d=2&e=30&c=2012
请帮我出的一样。
在此先感谢。
我想通过实时链接解析csv数据并将其转换为NSMutabledictionary.Here是我用于csv文件的链接。如何将csv文件数据转换为NSMutabledictionary
http://ichart.yahoo.com/table.csv?s=BAS.DE&d=2&e=30&c=2012
请帮我出的一样。
在此先感谢。
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];
http://stackoverflow.com/questions/3344628/where-can-i-find-a-csv -to-nsarray-parser-for-objective-c/3380724#3380724 ..浏览此文章 – Nit