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: Ken Tozier <email@hidden>
- Date: Thu, 12 May 2005 13:53:55 -0400
On May 12, 2005, at 1:33 PM, SA Dev wrote:
That's normally how I alloc/init things. When I found it didn't
work the normal way, I broke it up into two separate steps with
NSLog's before each telling me exactly where it was breaking, like
this.
Yes, but that's not what he asked and his point is a very valid
one. What he was asking is what happens if you *do* alloc/init it
all together? Have you tried?
Yes. The only reason I split it up into two steps was because the
normal way wasn't working and I wanted to see which step in alloc/
init was failing.
Allocating like this:
NSDisclosureButtonCell *result = [[NSDisclosureButtonCell
alloc] initWithControlSize: inControlSize];
fails with the exact same error message as:
NSDisclosureButtonCell *result = [NSDisclosureButtonCell
alloc];
// next line shows a valid object in "result"
NSLog(@"result = %@", result);
// chokes here
[result initWithControlSize: inControlSize];
error log:
*** -[NSDisclosureButtonCell initWithControlSize:]: selector not
recognized
I've read in multiple places that you should never split it up like
you're doing. It should always be alloc/init'd together.
Hadn't heard that. Although I never alloc/init in two steps unless
there is a problem and I want to see what's happening...
_______________________________________________
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