The constant *is* an NSString;  essentially you could do:

NSString *constValue = NSDeviceResolution;

Though, that may be a little redundant.

--Nick Paulson
On Jan 4, 2010, at 6:09 PM, David Alter wrote:

> This would work for finding out what the name is as well as logging it.
> 
> What if I'm getting a string passed in that is the name of the constant and
> I want to return the constants string value. Is there a way to do that?
> 
> something like...
> NSString * constValue = [SomeToolToLookupConstants constant:@
> "NSDeviceResolution'];
> 
> any idea?
> -dave
> 
> 
> On Mon, Jan 4, 2010 at 2:19 PM, Oftenwrong Soong
> <oftenwrongso...@yahoo.com>wrote:
> 
>> On Mon, Jan 4, 2010 at 4:56 PM, David Alter <alterconsult...@gmail.com>
>> wrote:
>>> Is there a way to lookup what and NString constant is at runtime?
>> 
>> 
>> 
>> Have you tried
>> 
>> [NSDeviceResolution description]
>> 
>> or
>> 
>> [NSString stringWithString:NSDeviceResolution]
>> 
>> ?
>> 
>> Soong
>> 
>> 
>> 
>> _______________________________________________
>> 
>> 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/alterconsulting%40gmail.com
>> 
>> This email sent to alterconsult...@gmail.com
>> 
> _______________________________________________
> 
> 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/cocoa%40nickpaulson.com
> 
> This email sent to co...@nickpaulson.com

_______________________________________________

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

Reply via email to