I'm porting some older code to my project. In this code, a variety of data types (integer, string, etc) are enumerated in a simple enumeration. I'd like to be able to automatically figure out what data type I need to use from a property's type or, since many properties are encapsulated in a NSNumber, for the -objCType returned by this.

My question is does @encode(...) return a static string for a given type, or not? Basically I'm wondering if I can do this:

if([myNumber objCType] == @encode(float)){...}

Or is it necessary to do a full string comparison? Performance could be an issue here, so I'd like to avoid a string compare if I don't need to do it.


tia,

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 [EMAIL PROTECTED]

Reply via email to