views:

271

answers:

1

Is there a better way to compare a NSNumber with a fixed value, it just feels a little clunky.

if([myNumber isEqualToNumber:[NSNumber numberWithInt:0]]) NSLog(@"Zero");

I do know I can use -compare but it pretty much looks the same ...

gary

+7  A: 

How about ([myNumber intValue] == 0)? (or < or >, obviously).

Ben Gottlieb
Doh :) perfect, many thanks Ben ...
fuzzygoat