From: Christiaan H. <chr...@we...> - 2005-11-27 18:25:55
|
On 27 Nov 2005, at 8:14 PM, Adam R. Maxwell wrote: > > On Nov 27, 2005, at 09:59, Christiaan Hofman wrote: > >> >> On 27 Nov 2005, at 7:43 PM, Adam R. Maxwell wrote: >> >>> >>> On Nov 27, 2005, at 07:14, Christiaan Hofman wrote: >>> >>>> >>>> On 27 Nov 2005, at 4:21 PM, Christiaan Hofman wrote: >>>> >>>>> When we load a nib file explicitly, should we release it later? >>>>> This applies e.g. to the BDSKAlert class, BibFiler and the >>>>> editor drawer. When should this be done, in the release method >>>>> of the controller? >>>>> >>>>> Christiaan >>> >>> I don't think we have any way to release nibs. I guess the >>> window can be released if it's not set to release when closed, >>> but nibs should be loaded for the life of the program (at least, >>> that's been my impression). >> >> What I meant more precisely is release the top level elements. I >> now did that in most cases where the nin is not the nib for a >> windowController, as those will do it automatically. Accrodign to >> the docs all other cases should be handled by the owner of the nib. > > Oh, okay. I never paid proper attention to that point (since we > mostly use NSWindowControllers anyway). > >> >>>> And what is the reason for explicitly loading the >>>> windowcontroller's nib in the error controller and in the file >>>> content search controller? init or initWithWindowNibName: should >>>> implicitly do that. >>> >>> The bundle wasn't being loaded for some reason, as I recall. >> hmm, strange. As mysteriously, that problem seems to be fixed now. >> >>> For the file content search, the window isn't being shown at all >>> if it's created with a document, and initWithWindowNibName is >>> never called. >>> >>> Adam >> >> I wonder why calling initWithWindowNibName: instead of init in our >> init doesn't work. > > I think you're supposed to be able to implement -init and - > windowNibName and things will just work. If awakeFromNib now gets > called without the bundle load, it can be removed. > > adam > It should, but doesn't work. I think it is a timing problem, the init does not wait till the nib is loaded while an explicit loadNibNamed: does. Maybe the error controller has the same problem. We had the same problem in the textImportController. Christiaan |