unsigned int bytes[] = {153, 3, 1, 0, 0, 4};
i used this
for(id b in bytes){
}
got an erro like
The type 'unsigned int *' is not a pointer to a fast-enumerable object
The code you're using as an example is just plain old C:
unsigned int bytes[] = {153, 3, 1, 0, 0, 4};
So to work with bytes you'd need to do things the plain old C way:
for (int i = 0; i < sizeof(bytes); i++) {
// do something with bytes[i]
}
If you want to do things using Objective-C's features, you'd use NSArray and NSNumber:
NSArray<NSNumber*> *numbers = @[@(153), @(3), @(1), @(0), @(0), @(4)];
and then you can use fast iteration:
for (NSNumber *number in numbers) {
//do something with number
}
The type 'unsigned int *' is not a pointer to a fast-enumerable object
You get that error because for...in is an Objective-C construction that only works with objects that support NSFastEnumeration. See the NSHipster post on NSFastEnumeration/NSEnumerator for a more extensive explanation.