I'm comparing two NSUInteger
, I kept getting crash thats says -[__NSCFNumber length]: unrecognized selector sent to instance
NSUInteger index = [masterArray indexOfObject:object];
if (index != NSNotFound){
if (index < [anArray count] - 1 ){
//Do something
}
else{
//Do something
}
}
Reading old post of similar question, but I still can't figure this out. I've tried to cast and it still crash:
NSUInteger index = [masterArray indexOfObject:object];
if (index != NSNotFound){
if (index < (NSUInteger)((int)[anArray count] - 1) ){
//Do something
}
else{
//Do something
}
}
However, without any minus operation, it works.
NSUInteger index = [masterArray indexOfObject:object];
if (index != NSNotFound){
if (index < [anArray count]){
//Do something
}
else{
//Do something
}
}
Any idea why? Thanks in advance.