What are the advantages of using NSNumber etc? (Apart from treating them like objects) Like memory management or performance benefits? Because its a lot of code when I simply would require a local variable; int, float, char etc.
What are the advantages of using NSNumber etc? (Apart from treating them like objects) Like memory management or performance benefits? Because its a lot of code when I simply would require a local variable; int, float, char etc.
Store them as primitives in your app when you can since NSNumber is immutable, and only use NSNumber when necessary (storing in an NSDictionary, NSUserDefaults, or any other API that requires an object, etc).
Obviously storing them in NSArrays and NSDictionaries, but also a much easier way to write them into a file since NSArray and NSDictionary can be serialized into a plist file as can NSNumber and NSString etcetera.