• 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: Nib loading and the externalNameTable: thing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nib loading and the externalNameTable: thing


  • Subject: Re: Nib loading and the externalNameTable: thing
  • From: James Quick <email@hidden>
  • Date: Tue, 22 Jul 2003 12:35:28 -0400

On Thursday, July 17, 2003, at 08:51 PM, Sailor Quasar wrote:

I've sent this before and gotten no answer; I intend to try once more. Does Anyone know anything about this?

In NSNibLoading.h, a category of NSBundle declares the following nib loading methods:

+ (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
+ (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner;

loadNibNamed:owner: is documented specifically as being similar to loadNibFile:externalNameTable:withZone: using an NSDictionary with a single key of NSOwner.

Now, I'm trying to pass a string of data to an object instantiated inside a nib that I don't have a direct reference to (no outlet for it in the file's owner). I could create the outlet to make it available, but first I want to know if there's a way to get this string to the object in its -awakeFromNib method. So I'm looking at this and I say, "hmm, an NSDictionary that's used for loading the nib. Can I use this?". I proceeded to search the developer docs for any reference whatsoever to the usage of the externalNameTable. Nothing. So I'm asking: can this dictionary be accessed from an awakened object's -awakeFromNib method, and if so can I specify a custom key/value pair along with NSOwner in that dictionary?

NSBundle is an abstract layer on top of that stuff. It does not document that method for
use by end users, so you should avoid it. If I were you I would use documented interfaces.

However, I strongly suggest that you take a step back and look at your design.
In MVC, you should be separating your interface from the rest of your design.
The object acting as the controller for the nib contents is the only logical place to
maintain the information needed for updating the interface element.

If the controller has no means knowing what this information is, it should
ask the model to provide the value.
_______________________________________________
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: Nib loading and the externalNameTable: thing
      • From: Sailor Quasar <email@hidden>
References: 
 >Nib loading and the externalNameTable: thing (From: Sailor Quasar <email@hidden>)

  • Prev by Date: Re: Emulating email apps To/Cc textfield?
  • Next by Date: Re: Emulating email apps To/Cc textfield?
  • Previous by thread: Nib loading and the externalNameTable: thing
  • Next by thread: Re: Nib loading and the externalNameTable: thing
  • Index(es):
    • Date
    • Thread