I am just trying to understand life of variables with a throw away below code. I can see _inside and _outside retains when about instantiate new instance, while braces are not.
@interface ViewController (){
NSString *_innBraces;
}
@end
NSString *_outside;
@implementation ViewController{
NSString *_inmBraces;
}
NSString *_inside;
-(id)initWithInside:(NSString*)inside outside:(NSString*)outside nBraces:(NSString*)nBraces mBraces:(NSString*)mBraces{
self = [super init];
if (self) {
_inside = inside;
_outside = outside;
_innBraces = nBraces;
_inmBraces = mBraces;
return self;
}else{
return nil;
}
}
- Is there any difference between the place of declaration of _inside and _outside?
- Any difference between braces variables from where it is declared?
- Any difference between static variable declared same way vs _inside/_outside variable?