I see code like this:
@synthesize dataController = _dataController;
What is the purpose of this in a view controller?
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.
If your class needs to store values, it needs someplace in memory to store this data. An instance variable reserves memory for the data your class needs.
Let’s assume you want to add a place for a string or
intvariable. You can use an instance variable to reserve that memory for the lifetime of the object. Each object will receive unique memory for its variables.It’s much like a C
struct:The
structdeclares two fields (a and b). Each value may be read and written to, and thestructis large enough to hold its fields.