I read a number of questions on this site about this problem, I understand the following:
self.property refers to the getter / setter method, either manually or through @synthesize. Depending on whether the property has been declared as saving, copying, etc., the Save account changes correctly, for example, a saved property, releases the previous value assigned to the new value with "save", and increases the number of deductions by 1.
Properties are usually declared with instance variables of the same name (they can be different if you perform the assignment manually). This is usually due to the fact that accessors created using @synthesize use an instance variable to reference an object in memory, and then execute the appropriate commands.
My question is based on the fact that in many examples self.property and the property are used interchangeably for different things, and I am having problems defining rules. One example in the sample Recipes example in Apple Docs:
self.navigationItem.title = recipe.name; nameTextField.text = recipe.name; overviewTextField.text = recipe.overview; prepTimeTextField.text = recipe.prepTime;
and...
self.ingredients = sortedIngredients;
Each of these properties has associated private instance variables of the same name. All are declared identically with non-atomic, persistent attributes. Each one is released at dealloc ...
Still, the "ingredients" are available through self, and the "prepTimeTextField" is available directly.
What is the reason for differences in access methods?
But what if I get access to the view delegate? Or a core-data object that was passed to the view controller by its previous view controller as a stored property?
Many thanks
properties objective-c self
Glynton
source share