I am new to objective-c and IOS, but have been programming in Visual Basic for a long time.
I can’t understand how does the possessions array get updated with the possession from ItemDetailViewController.
Setting the initial values for possession is clear in this line:
Next, leaving detailViewController, the code is also clear in updating possession:
// "Save" changes to possession
[possession setPossessionName:[nameField text]];
[possession setSerialNumber:[serialNumberField text]];
[possession setValueInDollars:[[valueField text] intValue]];
What I don’t understand is how the array is updated, I would expect some code somewhere like this:
[possessions replaceObjectAtIndex:[indexPath row] withObject:[detailViewController possession]; (This is just code to make my point)
I don’t see how the item in possessions gets updated with the new data in possession anywhere.