This simple question is bugging me. Are getters the same for
@property (nonatomic, retain) NSString *name
@property (nonatomic, copy) NSString *name
- (NSString*) name{
return name;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, as the other answers state, the getters are the same. The options
retain,copy, andassigndetermine how to generate setters, but not the names even of those.If you want to use a different getter name, for instance if you have a
BOOLsuch as theUIApplicationpropertyidleTimerDisabled, then you do this by specifically assigned the getter name:Without an override such as this, the getter name is always the property name.