加載我想從網絡服務器它獲取更新everyday.I正在使用此鏈接https://github.com/davedelong/CHCSVParser的csvparser,我用這個代碼解析CSV:CHCSVParser - 如何從網絡服務器
NSError *err = [[[NSError alloc] init] autorelease];
NSString *lunchFileURL = [[NSString stringWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *lunchFile = [NSString stringWithContentsOfURL:[NSURL URLWithString:lunchFileURL] encoding:NSUTF8StringEncoding error:&err];
CHCSVParser *p = [[CHCSVParser alloc] initWithContentsOfCSVString:lunchFile usedEncoding:&encoding error:nil];
我得到這個錯誤:
No visible @interface for 'CHCSVParser' declares the selector 'initWithContentsOfCSVString:usedEncoding:error:'
我檢查這個鏈接Load remote csv into CHCSVParser和它不工作。我是一個小白到iOS,請讓我知道如何解決這個問題。真的提前欣賞help.Thanks。
感謝Sachin的編輯。 –
僅供參考,我用兩個例子更新了我的答案。底線,'initWithContentsOfCSVString'是'NSArray'類別方法,而不是'CHCSVParser'方法。 – Rob