I’m creating an object that will have two integers (or NSNumbers) and an NSDate as ivars. This object will be in an NSMutableArray. To my knowledge, we cannot put primative integers in an NSMutableArray, but will my object work with ints? The reason I don’t want to use NSNumbers is because these will have to be mutable, and I don’t really want to create a new NSNumber everytime.
Also, will using ints create problems with iphone architecture differences?
1) You can safely use ints as ivars because they are wrapped in another object. NSNumber is just a Cocoa class wrapper for the different numeric types.
2)To be safe, you could use
NSUInteger, which istypedefed like this:So you will get the correct type for the current architecture.