For my new project. I uploaded the contents of the csv file as NSString. First, I need to split this into a new line and then split each line with a comma. How can I loop all this? Could you help me?
CSV Content
"^ GSPC", 1403.36, "4/27/2012", "4:32 pm", + 3.38, 1400.19.1406.64,1397.31,574422720 "^ IXIC", 3069.20, "4/27/2012", "5: 30 PM ", + 18.59,3060.34,3076.44,3043.30,0
ViewController.m
NSString* pathToFile = [[NSBundle mainBundle] pathForResource: @"quotes" ofType: @"csv"]; NSString *fileString = [NSString stringWithContentsOfFile:pathToFile encoding:NSUTF8StringEncoding error:nil]; if (!fileString) { NSLog(@"Error reading file."); } NSArray *array = [fileString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; for(int i=0; i<[array count]; i++){
ios objective-c iphone xcode nsstring
shebi
source share