I would like to convert downloaded string to NSArray. First of all I download data with URLFetcher. After that I need to convert my plist data to nsarray. But could not succeeded.
-(void)urlDidFinish:(UrlFetcher *)urlFetcher withString:(NSString *) responseString {
NSLog(@"Response: %@", responseString);
data = [NSArray arrayWithContentsOfFile:responseString];
[table reloadData];
}
This isn’t working because
arrayWithContentsOfFileis using the string as a path. In other words, it is expectingresponseStringto be a file on your computer, not a string that contains the data.Perhaps you could consider using
arrayWithContentsOfURLinstead, which might get the data from the URL automatically without having to download it yourself, but I’m not sure due to security restrictions and so on.You might be interested in this question: Parse Plist (NSString) into NSDictionary