Read csv file ios

前端 未结 1 664
余生分开走
余生分开走 2021-01-24 07:38

i have a problem for read a csv file. Only the last line of csv file is display. However in my fetchedResultsController i have 2 lines This is the code :

NSStri         


        
相关标签:
1条回答
  • 2021-01-24 08:18

    Try to use NSMutableString instead of NSString:

    NSMutableString *writeString = [NSMutableString string];
    

    And then in the for loop:

    [writeString appendString:[NSString stringWithFormat:@"%@, %@, %@, %@, \n", object1, object2, object3, object4]];
    
    0 讨论(0)
提交回复
热议问题