On 05/08/2009, at 6:27 PM, Alastair Houghton wrote:
Usually when you're using NSValue, you already know what type you're dealing with. If you have a situation where you need to distinguish between several different things, you might be better off making some wrapper classes (or maybe subclasses of NSValue, which is how NSNumber works).
Not only that, but note this from the docs for [NSNumber objCType]: "Special Considerations The returned type does not necessarily match the method the receiver was created with."
This makes it very hard to preserve type information using NSNumbers - integers and floats usually end up converted internally to doubles, I found. The same warning does not appear to be applied to NSValue however. If type is of critical importance though, I'd store it explicitly in an object of your own devising.
--Graham _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com