Hi everyone, sorry if this has been explained somewhere else, but I wasn’t able to find an answer that was clear enough.
I understand that declaring officeAlarmCode as such
BNREmployee.m
@inteface BNREmployee ()
@property (nonatomic) unsigned int officeAlarmCode;
@end
causes the setter and getter methods of officeAlarmCode to only be accessible within the implementation file (in this case, BNREmployee.m). However, what if we have a BNREmployee object that we need to set an officeAlarmCode to? By putting the @property declaration in the class extension, we can’t do that from main.m.
Naturally, the next step to accomplish this would be to declare the setter and getter methods myself. But this would require me defining the methods in the interface. So what’s the point of putting the officeAlarmCode in a class extension if when I need to set a value to it, I need to publicly declare the methods anyway? Hopefully I’m not missing something here.