Article View: comp.sys.next.programmer
Article #1457Re: loadNibSection return value
From: Gregory H. Anderson
Date: Mon, 12 Oct 1992 17:51
Date: Mon, 12 Oct 1992 17:51
30 lines
2045 bytes
2045 bytes
In article <BvrGB9.15x@oceania.com> chris (Chris Larson) writes: > The method: > > window = [NXApp loadNibSection:"NibFile.nib" owner:self]; > > currently returns a window pointer to one of the windows in the nib > section. Does anyone know if this is a stable "feature"? Current > documentation doesn't mention anything about the return value, other > than it won't be nil if the nib section is loaded correctly. This is different in 2.x and 3.0, so it's unsafe. Here's the scoop: In 2.x, the return value is the first window in the nib. That's why your code works right now. (We used this "feature", too.) In 3.0, nibs are stored in two pieces. One (data.nib) contains the object archive typedstream, the other (data.classes) contains a data structure which describes the class inheritance tree, outlets, and methods. It appears as though the 3.0 version of loadNibFile: returns the first window defined in data.classes, but there's no rhyme or reason to the order of this information in the file. We have several data.classes with the same three classes in different orders. Maybe you could edit data.classes after the fact to keep the right window on top, but it's a helluva price to pay for the benefit. The solution: make "file's owner" the correct object and let loadNibFile: make the connection for you. -- Gregory H. Anderson | "We're very tolerant around here, Benevolent Dictator-for-Life | being only amateurs ourselves." Anderson Financial Systems | - Tortoise (Godel, Escher, Bach) greg@afs.com (Nextmail OK) |
Technical Details
Message-ID:
<1992Oct12.175147.2022@afs.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!rpi!scott.skidmore.edu!psinntp!psinntp!afs!gregReferences:
<BvrGB9.15x@oceania.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!rpi!scott.skidmore.edu!psinntp!psinntp!afs!greg From: greg@afs.com (Gregory H. Anderson) Subject: Re: loadNibSection return value Message-ID: <1992Oct12.175147.2022@afs.com> Sender: greg@afs.com Reply-To: greg@afs.com References: <BvrGB9.15x@oceania.com> Distribution: na Date: Mon, 12 Oct 1992 17:51:47 GMT Lines: 30