• 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: init with parameters for objects in interface builders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: init with parameters for objects in interface builders


  • Subject: Re: init with parameters for objects in interface builders
  • From: Louis Foucart <email@hidden>
  • Date: Tue, 15 Oct 2002 14:06:48 -0300

They are subclasses of NSObject. The problem is that they are created by the application when it processes the nib file. I don't have any control on the init phase of these objects.
So I have a main class (a NSView) which should initialize other objects in its initWithFrame method. The fact is that some objects (IBOutlets) are null when I want to init them.
Sample:
I have a custom NSView and a custom NSObject called controller initialized in the nib file.
The NSView interface looks like this :
IBOutlet Controller controller;

The NSView method looks like this:
- (void)initWithFrame:(NSRect)frame {
...
[controller initWithX:frame.x y:frame.y]; // I need objects specified earlier in this method, for example frame is defined in the nib file
}

But controller is null when NSView initWithFrame is called.
Where can I put my init call on controller ?
Is there something nicer than call a setup method from the controller on the view, which method will call back initWithx:y: on the controller ?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: init with parameters for objects in interface builders
      • From: "Clark S. Cox III" <email@hidden>
  • Prev by Date: Re: Keyboard shortcuts for views in toolbar items
  • Next by Date: Re: EOF - was (Cocoa Books (was New to Cocoa) )
  • Previous by thread: Re: init with parameters for objects in interface builders
  • Next by thread: Re: init with parameters for objects in interface builders
  • Index(es):
    • Date
    • Thread