I'm trying to get into the Mac programming platform and therefore I'm in the middle of learning some Cocoa and Objective-C.
I've read that instance variables are private by default, and the convention is to use accessors of the form:
That's all fine and dandy.
Then I read about key-value coding and that seems cool and all, but apparently if the accesssor does not exist key-value coding simply accesses the instance variable directly!
That blows a big hole in the "encapsulation wall". If I didn't supply an accessors it's because I don't want anyone peaking at my internals (well, my class' internals).
Maybe I missed something....???
I've read that instance variables are private by default, and the convention is to use accessors of the form:
Code:
-(Type)property;
-(void)setProperty(Type *):aType;
That's all fine and dandy.
Then I read about key-value coding and that seems cool and all, but apparently if the accesssor does not exist key-value coding simply accesses the instance variable directly!
That blows a big hole in the "encapsulation wall". If I didn't supply an accessors it's because I don't want anyone peaking at my internals (well, my class' internals).
Maybe I missed something....???