New to obj-C and Cocoa here
I'm trying to just increment a variable in a method and, being used to C++, I want to just use the terminology of variable++, but that doesn't work on an NSNumber, so I've come up with
player1Points = [NSNumber numberWithInt: ([ player1Points intValue ] + 1) ];
I am tempted to just redeclare player1Points as an int in the header, but I want to keep @synthesize and @property so that I don't have to write get and set routines.
Is there an easier way to write this line of code?
@synthesize
and@property
with anint
property. – Carl Norum