Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

msUnique

macrumors newbie
Original poster
Mar 3, 2013
1
0
Hi I am new to xcode and objective C, I have a section of code that I want to add by know that the syntax is wrong please can somebody help me
Code:
int j, i=0;
    
    //while ((nextLine = read.readNext()) != NULL)
    
    //{ //while the line inputed is not empty do
        
       for(j=0;j<=6;j++)
    
               
       
            
       // data[i][j]=nextLine[j].toLowerCase();
        
        i++; // this increses i with 1
    
//}
           
That is the code that I am trying to add to this one 
  datasetfile = @"german_credit";
    CSVReader *csvReader = [[CSVReader alloc] initWithFile:datasetfile];
    //NSLog(@"getColumnHeaderAtIndex: %@", [csvReader getColumnHeaderAtIndex:0]);
    //NSLog(@"getColumnContentsAtIndex: %@", [csvReader getColumnContentsAtIndex:0]);
    NSLog(@"getRowAtIndex: %@", [csvReader getRowAtIndex:1]);
    testLabel.text = [NSString stringWithFormat:@"getRowAtIndex: %@", [csvReader getRowAtIndex:1]];
    //NSArray *stringArray = [NSArray arrayWithObjects:@"nextLine", @"readNext", @"data",NULL, nil];
    //NSLog(@"count = %d", [stringArray count]);
 
Last edited by a moderator:
Hi I am new to xcode and objective C, I have a section of code that I want to add by know that the syntax is wrong please can somebody help me
Code:
int j, i=0;
    
    //while ((nextLine = read.readNext()) != NULL)
    
    //{ //while the line inputed is not empty do
        
       for(j=0;j<=6;j++)
    
               
       
            
       // data[i][j]=nextLine[j].toLowerCase();
        
        i++; // this increses i with 1
    
//}
           
That is the code that I am trying to add to this one 
  datasetfile = @"german_credit";
    CSVReader *csvReader = [[CSVReader alloc] initWithFile:datasetfile];
    //NSLog(@"getColumnHeaderAtIndex: %@", [csvReader getColumnHeaderAtIndex:0]);
    //NSLog(@"getColumnContentsAtIndex: %@", [csvReader getColumnContentsAtIndex:0]);
    NSLog(@"getRowAtIndex: %@", [csvReader getRowAtIndex:1]);
    testLabel.text = [NSString stringWithFormat:@"getRowAtIndex: %@", [csvReader getRowAtIndex:1]];
    //NSArray *stringArray = [NSArray arrayWithObjects:@"nextLine", @"readNext", @"data",NULL, nil];
    //NSLog(@"count = %d", [stringArray count]);

I don't understand how the C code at the beginning of your post relates to the second part. You're going to have to paint a clearer picture of what you want to do.

BTW, Objective C is a pure superset of C, so you could write the C code you posted pretty much as is (except for the read.readNext() bit.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.