Hello,
NSNumber, the wrapper class for integers, float, chars etc. is immutable. Ok, it must be a good reason for this. You can’t access the internal value: it is read-only. Attempting to set this value stops you at compile time, with a disgusting, infamous reddish rectangle over the guilty line. Don’t touch this value.
Well, this is pretty-like constants. OK, a bit expensive constants.
Now, if you want to store them in a property list, you can, for example, bind a NSNumber with a boolean value to a checkbox. Plist file is loaded, your property is set to NO, the checkbox is unchecked. Life is wonderful.
Now, you decide this checkbox deserves to be checked, because you really want this option of your app to be active. You check. Then you quit the application. Preferences are saved. All this has a taste of paradise.
When you launch the application again, the checkbox, of course, is checked. Accidents never happen in a perfect world.
But. wait. Does it mean the value of the property has been changed? But you can’t change it, the compiler has said «bad boy, leave this poor boolean value alone», so how, when, at which missed page of the docs could this immutable value be changed?
Thanks for an explanation.