Cómo atravesar matrices en iOS
NSArray * ary = @[@"我",@"是",@"张",@"小",@"时",@"uh"] ;
for(int I = 0; iltary.counti){
NSLog(@"@",[objeto ario en índice: I]);
}
2. Se utiliza para atravesar
NSArray * ary = @[@"我",@"是",@"张",@"小",@ "Times. ", @"uh"】;
for (ns string * str in ary) {
NSLog (@"@", str);
}
Usar do while
NSArray * ary = @[@"我",@"是",@"张",@"小",@"时", @" uh"】;
int I = 0;
Hacer {
NSLog(@"@",[objeto ario en índice: I]); p>
i ;
} while (I lt; ary . count);
}
4.
NSArray * ary = @[@"我",@"是",@"张",@"小",@"时",@"uh"];
int I = 0;
while(iltary.count){
NSLog(@"@",[objeto ario en índice: I]);
i;
}
5. Utilice enumeración rápida
NSArray * ary = @[@"I",@"是",@"张", @"小",@"期",@"uh"】;
[Ali enumerateobjectsusingblock: ^(id?_Nonnull obj, NSUInteger idx, BOOL *_Nonnull stop){
NSLog (@"LD,@,@",idx,[ary objectAtIndex:idx],obj);
}];
6.
NSArray * ary = @[@"我",@"是",@"张",@"小",@"时",@"uh"];
DISPATCH _ QUEUE _ t QUEUE = DISPATCH _ QUEUE _ create("QUEUE", DISPATCH _ QUEUE _ CONCURRENT);
dispatch_apply([recuento de matrices], cola, ^(size_t index) {
NSLog (@" LD,@",index,[ary objectAtIndex:index]);
});