小编Mat*_*att的帖子

将远程csv加载到CHCSVParser中

大家好.我正在使用Dave DeLong的CHCSVParser来解析csv.我可以在本地解析csv,但我无法加载远程csv文件.今天我一直盯着我的MacBook方式,答案就在我面前.这是我的代码:

NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"];
NSURL *lunchFileURL = [NSURL URLWithString:urlStr];
NSStringEncoding encoding = 0;
CHCSVParser *p = [[CHCSVParser alloc] initWithContentsOfCSVFile:[lunchFileURL path] usedEncoding:&encoding error:nil];
[p setParserDelegate:self];
[p parse];
[p release];
Run Code Online (Sandbox Code Playgroud)

感谢有人能给我的任何帮助.

csv iphone

3
推荐指数
1
解决办法
1569
查看次数

标签 统计

csv ×1

iphone ×1