Theocacao
Leopard
Design Element
Comment on "CocoaHeads: Objective-C 2.0"
by Scott Stevenson — Sep 15
@Russell Finn:
How would your hypothetical scientist feel about using actual Objective-C syntax, which would look more like [z plus: w]
This is a good point because the Objective-C 2.0 dot syntax does not support methods with arguments like object.add(1,2) or even object.print(1). It's designed for property setters and getters:
object.name = @"Leopard"; NSLog(@"name: %@", object.name);

Messages that do not involve the setting and getting of properties still look like this in Objective-C 2.0:
NSString *newString = [string stringByAppendingString:@"New String"];
Back to "CocoaHeads: Objective-C 2.0"
Design Element

Copyright © Scott Stevenson 2004-2015