I work through some Objective-C code that I did not write, and found a variable declaration style that I am not familiar with. Can someone tell me about the scope of the variable myVar in the implementation of the class below? Note that this is displayed in the .m file, and not in the interface declaration.
@implementation MyClass
@synthesize ivar1, ivar2;
NSString* myVar;
- (id)init {
...
@end
It seems to me that the intent is similar to the intent of a member variable. What are the benefits of declaring a variable this way instead of using ivar in the @interface declaration?
source
share