Im not understanding why people use extensions to make variables private instead of just declaring them only in the implementation file ?
Take a look at this code one using extension and one using a instance variable:
//this is an extension
@interface MyClass () {
NSString *myInstanceVariable;
}
// ...
@end
or in the class implementation:
@implementation MyClass {
NSString *myInstanceVariable;
}
// ...
@end
both give me instance variables that would be private. Why would i choose a extension instead of the 2nd approach of just declaring a instance variable ?