I just put int anInteger in the @intergace without giving it @property (nonatomic, assign) or synethezing it.
Should I be giving it a property?
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.
It depends. I try to always use properties. Even though it has some (constant) overhead, it makes my code clearer. If you ever want to refactor the class, it makes it a lot easier if users (which might just be yourself) don’t depend on your ivar.
Also, if you ever want to do Key-Value Observing then having a property with synthesized accessors makes sure your class is KVO-compliant.