Last summer I completed most of the 2nd edition last year, and went on to develop my first app (all be it a simple one) which is in the iTunes store.
I then returned to my studies at University, and did not manage to continue my learning as much as I would have liked, however did manage to develop a second app before the end of the year.
Anyway, I decided to purchase the Objective-C Programming, The Big Nerd Ranch Guide, and the third edition of iOS Programming to get up to speed with ARC, iOS 5…
What am I finding, is that now and again I am questioning parts of the code we type in from the book (which I did not do first time round), which hopefully is by no means a bad thing? I put it down to simply being slightly overwhelmed first time round by what I was doing, along with not fully understanding every single piece of code.
Now to my questions:
In this chapter, when creating the BNRItemStore, we create a getter method for allItems, which returns a pointer to a NSArray. My first question is why do we return a pointer to a NSArray, and not a NSMutableArray which is what we declared the variable as?
Secondly, why have we created the getter method for allItems, instead of declaring a read only property for it?