I am very new to Objective-C. I know C and C++ but Objective-C has quite the learning curve. Anyway, is there a shorter way (possibly by some kind of NSNumber literal if such exists) to write the following:
[Tyler setArms:[[[NSNumber alloc] autorelease] initWithInt:1]];
Yes, just use one of the many helper functions such as
numberWithInt::The expression
[NSNumber numberWithInt:1]is equivalent to[[[NSNumber alloc] initWithInt:1] autorelease], which is equivalent to[[[NSNumber alloc] autorelease] initWithInt:1]. The latter expression is extremely uncommon.