Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: null selector



On 9/14/05, Keith Alperin <email@hidden> wrote:
> Greetings Cocoa-Devs!
> 
> I'm trying to implement a callback using an NSInvocation.  However,
> when i call invoke, i get: "<NSInvalidArgumentException> *** -
> [MyTestApp methodSignatureForSelector:]: null selector".
> 
> Here is some test code that I am using:
> 
> - (void)awakeFromNib {
>      SEL *handlerSelector = @selector(someMethod: otherArg:);
>      NSMethodSignature *signature = [self methodSignatureForSelector:
> handlerSelector];
>      NSInvocation *handler = [NSInvocation
> invocationWithMethodSignature: signature];
>      [handler setTarget:self];
>      [handler retain];

You never call setSelector: on the invocation, so it has a method
signature but no idea what method to call. Signatures just contain
type information. Also, handlerSelector should be of type SEL, not SEL
*.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >null selector (From: Keith Alperin <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.