I have troubles converting id of an object to int (or NSINteger), so that I can use it in a loop later.
Here is the case:
// "tasks" is a mutable array
int taskNo = [[tasks indexOfObject:@"something"] integerValue];
But it results in:
Bad receiver type 'NSUInteger' (aka 'unsigned int')
I found a similar thread with code similar to what I have above, but unfortunately it didn't work for me. I guess I must be missing something simple.
Thanks a lot!
int taskNo = (int)[tasks indexOfObject:@"something"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With