hello大家好
需要在代碼實現快速enumeration,不知道應該怎麼做?
int xx;
int b=0;
for (xx=0 ; xx<(distancearray.count); xx++) {
if ([NSNull null]!=[distancearray objectAtIndex:xx]&& 0 !=[[[distancearray objectAtIndex:xx] description] intValue] ) {
b++;
latitudeLabel.text=[NSString stringWithFormat:@" %d",b*100];
}
}
試試:
for( id object in distancearray){
if ([NSNull null]!=object && 0 !=[[object description] intValue] ) {
b++;
latitudeLabel.text=[NSString stringWithFormat:@" %d",b*100];
}
}