I have defined a property...
@property (nonatomic, strong) NSArray *eventTypes;
I want to override the getter and setter...
I have written this...
- (void)setEventTypes:(NSArray *)eventTypes
{
_eventTypes = eventTypes;
//do some stuff here.
}
This works fine but when I then add this...
- (NSArray*)eventTypes
{
//do some stuff here.
return _eventTypes;
}
Then both of the functions show errors and don't know what _eventTypes is.
This is the same either way around. It works with one function but as soon as I add the other it fails both of them.
Is there something else I need to do for this? Seems odd that it work with either one bot not both.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…