iOS---把字符串分割成数组

    

    NSArray *lab = [status.labels componentsSeparatedByString:@","];



   NSString *button0 = [lab objectAtIndex:0];

      NSString *button1 = [lab objectAtIndex:1];

      NSString *button2 = [lab objectAtIndex:2];

      NSString *button3 = [lab objectAtIndex:3];


    NSLog(@" 0 %@ ",button0);

    NSLog(@" 2 %@ ",button1);

    NSLog(@" 1 %@ ",button2);

    NSLog(@" 3 %@ ",button3);


    NSLog(@" l %lu ",(unsigned long)lab.count-1);


你可能感兴趣的:(iOS--小知识点)