Re: Toplevel Objects in NIB files
Re: Toplevel Objects in NIB files
- Subject: Re: Toplevel Objects in NIB files
- From: Vince DeMarco <email@hidden>
- Date: Thu, 4 Apr 2002 15:52:20 -0800
On Thursday, April 4, 2002, at 01:51 PM, Nat! wrote:
Am Mittwoch den, 3. April 2002, um 19:42, schrieb Vince DeMarco:
If you really want to do this, basically you do this here.
use the NSBundle method loadNibFile: externalNameTable:withZone:
[NSBundle loadNibFile:windowPath externalNameTable:[NSDictionary
dictionaryWithObjectsAndKeys:[self owner], @"NSOwner", topLevelObjects, @
"
NSTopLevelObjects", nil] withZone:[self zone]]
the NSMutableArray (topLevelObjects) will then get filled with all of
them.
vince
Works nicely. Testing this I found that no "NSNibConnector" (and
subclasses) objects show up. As nibtool hints "Connectors" appear to be
stored outside the object hierarchy, so they probably are used in the NIB
loading process to wire things up [and then they are "forgotten" (?)]
Is there another key like "NSConnectors" to get the connectors too ?
Looking with strings through AppKit I didn't find a likely candidate.
What I am also wondering is, who owns and releases the connectors? If
there is no "NSConnectors" key, the NSWindowController probably can't do
that. And the views can't either, because at best they know about the
connector as a delegate (and they don't retain/release the delegate). The
connectors themselves can't know when the views "disappear". Is this a
built in memory leak ?
After the connections are made the connectors are all released. They don't
leak (or at least they should not leak)
NSNibConnectors are not considered top level objects they are just managed
by IB and the runtime on its own.
There is no key to get all of the connectors.
If you write a palette in IB you can ask the IBDocuments object for
connectors and look there.
look at all of the IB frameworks in
/System/Library/Frameworks/InterfaceBuilder.framework
vince
_______________________________________________
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.