I’m a newer in Objective C. I found can access the private variable outside. I just get a warning Like follows:
@interface foo : NSObject
{
@private
int b;
}
-(id) init;
@end
//omit the implement
int main()
{
foo *a = [[foo alloc] init];
printf("%d", a->b);
}
So dose the private keyword only work on its subclass? If Yes, why need protected keyword