• 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: awakeFromNib not called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: awakeFromNib not called


  • Subject: Re: awakeFromNib not called
  • From: Sherm Pendley <email@hidden>
  • Date: Tue, 11 Oct 2005 03:13:16 -0400

On Oct 10, 2005, at 8:47 PM, Paul J. Lucas wrote:

    So after reading lots of documentation and tutorials, my
    awakeFromNib still isn't being called even though, as far as I
    can tell, I'm doing everything right.

    Here's a crazy thought: is there any problem with having the
    class be in Objective C++ rather than Objective C?

    If this were ordinary C vs. C++, there would be a name-mandling
    issue, i.e., a function that's expected to be called as a C
    function must be declared as extern "C".  Is there such an
    issue for Objective C vs. Objective C++?

    If my awakeFromNib is undergoing name-mangling, that would
    explain why it's not being called.

Um... a stupid question maybe. Apologies in advance if it is.

Your awakeFromNib method *is* in an Objective-C class, right? Not a C+ + class?

Objective-C++ allows Objective-C objects to have C++ objects as instance variables, and call their methods using C++ syntax. And vice- versa. But that's pretty much all. You can't assign a C++ object as a delegate, for instance, or have it receive notifications. If you've instantiated an Objective-C object in a nib, its awakeFromNib will be called. But, if that object has a C++ object as an instance variable, the C++ object usually won't be automatically instantiated (there's a new option to do so in GCC 4) and the C++ object's awakeFromNib method, if it has one, won't be automatically called.

For more details about how Objective-C and C++ are integrated - and how they're not - have a look at:

<http://tinyurl.com/bts5l> <http://developer.apple.com/documentation/ Cocoa/Conceptual/ObjectiveC/LanguageOverview/chapter_4_section_10.html>

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
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: awakeFromNib not called
      • From: "Paul J. Lucas" <email@hidden>
References: 
 >awakeFromNib not called (From: "Paul J. Lucas" <email@hidden>)
 >Re: awakeFromNib not called (From: j o a r <email@hidden>)
 >Re: awakeFromNib not called (From: "Paul J. Lucas" <email@hidden>)
 >Re: awakeFromNib not called (From: "Paul J. Lucas" <email@hidden>)

  • Prev by Date: Re: Newbie Q: equipping an NSDocument subclass with a window controller
  • Next by Date: Re: Newbie Q: equipping an NSDocument subclass with a window controller
  • Previous by thread: Re: awakeFromNib not called
  • Next by thread: Re: awakeFromNib not called
  • Index(es):
    • Date
    • Thread