Hi,
For very basic numeric quantities why not just use primitives?
I've seen code using NSNumber just to hold an integer, such as the quantity of a certain number of items. Why not just use int?
The setter code has to retain and release the NSNumber. I am wondering why bother? What's the benefit? (Future planning notwithstanding, since I can't imagine that variable to hold anything except for an integer).
Thanks.
For very basic numeric quantities why not just use primitives?
I've seen code using NSNumber just to hold an integer, such as the quantity of a certain number of items. Why not just use int?
The setter code has to retain and release the NSNumber. I am wondering why bother? What's the benefit? (Future planning notwithstanding, since I can't imagine that variable to hold anything except for an integer).
Thanks.