• 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: 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
  • Follow-Ups:
    • Re: Why would a defined selector not be found at runtime?
      • From: Douglas Davidson <email@hidden>
References: 
 >Why would a defined selector not be found at runtime? (From: Ken Tozier <email@hidden>)
 >Re: Why would a defined selector not be found at runtime? (From: Ricky Sharp <email@hidden>)
 >Re: Why would a defined selector not be found at runtime? (From: Ken Tozier <email@hidden>)
 >Re: Why would a defined selector not be found at runtime? (From: SA Dev <email@hidden>)

  • Prev by Date: Re: Why would a defined selector not be found at runtime?
  • Next by Date: Re: Why would a defined selector not be found at runtime?
  • Previous by thread: Re: 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