• 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: Why would a defined selector not be found at runtime?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why would a defined selector not be found at runtime?


  • Subject: Re: Why would a defined selector not be found at runtime?
  • From: Ricky Sharp <email@hidden>
  • Date: Thu, 12 May 2005 10:37:04 -0500


On May 12, 2005, at 4:46 AM, Ken Tozier wrote:

And it's being called from the factory method like this:

#import "NSDisclosureButtonCell.h"

@implementation UIControls

+ (NSDisclosureButtonCell *) plainDisclosureBezelInView:(NSView *)
inView
           origin:(NSPoint) inOrigin
           size:(NSControlSize) inControlSize
{
     NSDisclosureButtonCell    *result        =
[NSDisclosureButtonCell alloc];

     // always chokes on the next line at runtime
     [result  initWithControlSize: inControlSize];

     [result setState: NSOffState];

     return [result autorelease];
}

@end


As is clear from above, everything seems to be defined correctly and the necessary "#import" directives are present, so why am I getting "*** -[NSDisclosureButtonCell initWithControlSize:]: selector not recognized" at runtime?

Hmm, I think this has something to do with splitting up the alloc and init calls. I seem to recall some thread about this a while back.


At any rate, what happens if you do this instead:

NSDisclosureButtonCell* result = [[NSDisclosureButtonCell alloc] initWithControlSize:inControlSize];


Other notes...

It appears that NSDisclosureButtonCell is your own class, thus you shouldn't name it with the 'NS' prefix.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.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: Why would a defined selector not be found at runtime?
      • From: Sherm Pendley <email@hidden>
    • Re: Why would a defined selector not be found at runtime?
      • From: Ken Tozier <email@hidden>
References: 
 >Why would a defined selector not be found at runtime? (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: saving images on panther
  • Next by Date: Re: CoreData could not fulfill a fault
  • Previous by thread: Why would a defined selector not be found at runtime?
  • Next by thread: Re: Why would a defined selector not be found at runtime?
  • Index(es):
    • Date
    • Thread