• 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: Interface builder, .nibs, etc ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interface builder, .nibs, etc ...


  • Subject: Re: Interface builder, .nibs, etc ...
  • From: Dustin Voss <email@hidden>
  • Date: Tue, 16 Dec 2003 17:21:36 -0800

On 16 Dec, 2003, at 1:24 PM, Stiphane Sudre wrote:

Just drag a custom view instead of a window. And it will be your root widget that you will be able to add dynamically to the Inspector Window.

To expand on this answer, I have built view controllers analogous to window controllers, where the view controller is the owner of a view-only NIB. I only need to use this technique because I put the view in its own NIB and make multiple instances of it programatically. If you only need one instance of the view, it'd be easier to put in in the inspector window's NIB.

I use NSNib to pre-load the NIB and instantiate it as many times as I need to. Each time I instantiate it, I use a new controller object as the file owner. NSNib sets all the outlets of the controller object. One of the outlets is for the view itself. I use that outlet to add the view to its superview.

The only problem I've found is in managing the lifetime of the NIB's top-level objects. Apparently, once the view is added to its superview, the view controller can no longer release it, and I get a (seemingly harmless) malloc error. It is curious, and I worry about memory leaks.
_______________________________________________
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: Interface builder, .nibs, etc ...
      • From: Amul Goswamy <email@hidden>
    • Re: Interface builder, .nibs, etc ...
      • From: Chuck Soper <email@hidden>
    • Re: Interface builder, .nibs, etc ...
      • From: Chuck Soper <email@hidden>
References: 
 >Re: Interface builder, .nibs, etc ... (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: Using custom NSValueTransformer objects in single-window applications
  • Next by Date: [Q] creating document packages?
  • Previous by thread: Re: Interface builder, .nibs, etc ...
  • Next by thread: Re: Interface builder, .nibs, etc ...
  • Index(es):
    • Date
    • Thread