I saw this thread, but am not completely clear in iOS7 given the Programming guide says you can leave out the @synthesise
keyword for properties.
I want to have a @property
that is readonly
externally, but readwrite
internally. Can I use just the @property
keyword like this?
EDIT: What would be considered more correct, or at least more idiomatic, of the answers provided. To have a separate readwrite
property in a Class extension or access the ivar directly in the implementation?
EDIT: To show that I am using a Class Extension, as suggested in answers.
//.h
@interface CACustomerAuthenticator : NSObject
@property (nonatomic, copy, readonly) NSString *username;
@end
//.m
@interface CACustomerAuthenticator ()
@property (nonatomic, copy, readwrite) NSString *username;
@end