• 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
null selector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

null selector


  • Subject: null selector
  • From: Keith Alperin <email@hidden>
  • Date: Wed, 14 Sep 2005 06:48:08 -0500

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];
int *someArg = 1;
int *otherArg = 2;
[handler setArgument:&someArg atIndex:2];
[handler setArgument:&otherArg atIndex:3];
[handler invoke];
}


- (void)someMethod:(int)someArg otherArg:(int)otherArg {
    NSLog("keyCode=%d",someArg);
    NSLog("modifierFlags=%d",otherArg);
}

the "someMethod" method is declared in the header file. The error occurs when calling [handler invoke].

Does anyone out there in cocoa land see the problem? This feels like a rookie mistake, but as a cocoa rookie, I can't really tell what that is.

Many thanks,
Keith R. Alperin
kalperin mac com

_______________________________________________
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


  • Follow-Ups:
    • Re: null selector
      • From: Stefan Schüßler <email@hidden>
    • Re: null selector
      • From: Nick Zitzmann <email@hidden>
    • Re: null selector
      • From: Ryan Britton <email@hidden>
    • Re: null selector
      • From: Pontus Ilbring <email@hidden>
  • Prev by Date: Re: NSFileHandle thread safe ?
  • Next by Date: Re: NSArrayController selectNext updating late
  • Previous by thread: Re: Silly newbie Q about delegates
  • Next by thread: Re: null selector
  • Index(es):
    • Date
    • Thread