Re: Why would a defined selector not be found at runtime?
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