• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: null selector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: null selector


  • Subject: Re: null selector
  • From: Keith Alperin <email@hidden>
  • Date: Thu, 15 Sep 2005 07:10:11 -0500

in order to get this example to work, I needed to change the my pointer to a SEL (*handlerSelector) into a plain old SEL (handlerSelector), and the same with the two integers (someArg and otherArg). Finally, I did need to call [handler setSelector:handlerSelector] .

Given my trouble with pointers, can you tell that I come from a java background? ;-)

Thanks to everyone for their help!

Keith

On Sep 14, 2005, at 8:27 AM, Pontus Ilbring wrote:

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: This email sent to email@hidden
References: 
 >null selector (From: Keith Alperin <email@hidden>)
 >Re: null selector (From: Pontus Ilbring <email@hidden>)

  • Prev by Date: Re: Disabling Display of JPG and PDF Files in NSTextView
  • Next by Date: [NSApple setApplicationIconImage:]
  • Previous by thread: Re: null selector
  • Next by thread: Re: null selector
  • Index(es):
    • Date
    • Thread