Would you know a way to make a property readonly for outside calls and readwrite for inside calls ?
I've read times ago somthing that seemed like
In the .h
@property(nonatomic, readonly) NSDate* theDate;
In the .m
@interface TheClassName()
@property(nonatomic, retain) NSDate* theDate;
@end
but this raises a warning when compiling the .m "Property theDate attribute in TheClassName class continuation does not match class TheClassName property".
Anyway, it seems to work (can read but not set from outside the class, can do both from inside) but I should have missed somehting to avoid the warning.
Or if you know a better way to do this...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…