Hi I have a csv file and I would like to parse the information there on an array so I can use it on a map. Heres is what I have from the parsing part:
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"Geolocalizadas" ofType:@"csv"];
NSString *content = [NSString stringWithContentsOfFile:filepath encoding:NSUTF8StringEncoding error:nil];
NSLog(@"array: %@", content);
NSArray *arrayfarm = [content componentsSeparatedByString:@"\n"];
for (NSString *item in arrayfarm) {
NSArray *itemArray = [item componentsSeparatedByString:@","];
// log first item
NSLog(@"%@",[itemArray objectAtIndex:0]);
}
I use the nslog onthe content and array and always get (null)