In Objective-C from my understanding.
[NSOnedayInstancedrink drink:*Beer];
Is the same as:
NSOnedayInstancedrink.drink = *beer
Why the difference, well from what I’ve been reading, you want to use a @property versus bracket notation in these use-case scenarioes:
* Use @property to declare the state exposed by your objects.
* Use dot notation to get and set objects’ state.
* Use method declarations to declare the behavior exposed by your objects.
* Use bracket notation to invoke objects’ behavior.
The idea is to separate STATE from BEHAVIOR. For example NSOnedayInstancedrink.drink = *beer is a state, where as [NSOnedayInstance consumeDrink:*beer is a behavior.
Tags: iphone development, iphone-development OpenGL-ES snippet, note gotcha, Uncategorized