I've started to learn objective-C / cocoa and i'm from a strong Java background.
One of my major gripes with objective-c is that you define instance variables within the interface. This goes against what i've learnt, which is that instance variables are implementation details.
What if i want to implement a class with my own set of instance variables? Can i define them in the interface section or am I forced to creat a sub-class?
Moreso, what is the motive behine Apple to so this way in making developers specify instance variables within an interface?
by Gav Newalkar — Jan 24
I've started to learn objective-C / cocoa and i'm from a strong Java background.
One of my major gripes with objective-c is that you define instance variables within the interface. This goes against what i've learnt, which is that instance variables are implementation details.
What if i want to implement a class with my own set of instance variables? Can i define them in the interface section or am I forced to creat a sub-class?
Moreso, what is the motive behine Apple to so this way in making developers specify instance variables within an interface?
Gav