Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSExpression
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSExpression



On Jun 28, 2008, at 12:13 AM, Chris <email@hidden> wrote:


NSExpression defines this method:

+ (NSExpression *)expressionForFunction:(NSString *)name arguments: (NSArray *)parameters

and the doco provides this example:

[NSExpression expressionForFunction:(@selector(random)) arguments:nil];


Isn't that wrong? Can you really pass a selector to a NSString argument? The compiler is complaining, and the program crashes when I attempt.

Yeah it is wrong. I believe you just pass a string with the same contents as what you would put in @selector.


-shawn
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >NSExpression (From: Chris <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.