Re: loadNibNamed: wiring question
Re: loadNibNamed: wiring question
- Subject: Re: loadNibNamed: wiring question
- From: Brian Stern <email@hidden>
- Date: Thu, 23 Oct 2003 10:50:04 -0400
At 7:07 AM -0400 10/23/03, Matthew Weinstein wrote:
>
I'm loading an nsdocument from nib. The problem is that the window
>
doesn't quite respond the way I need it to. Specifically, my window
>
doesn't seem to respond to updateChangeCount (at least the black dot
>
doesn't appear in the close button). Is there something else I need
>
to call or wire (IB) to make the window respond?
>
>
Here is how I'm loading the window
>
myReport = [[MWSummaryReport alloc] init];
>
[myReport setData: [resultClass hotData] andReport: r];
>
[myReport setDateFormat: [resultClass dateFormat]];
>
[NSBundle loadNibNamed: @"MWSummaryReport" owner: myReport];
>
[myReport windowControllerDidLoadNib: nil];
>
[[myReport window] makeKeyAndOrderFront: self];
>
[myReport buildSummary];
I do it like this and it seems to work:
doc = [[[MyDocument alloc] initWith
Data:newData ofType:MyType] autorelease];
[doc makeWindowControllers];
[[NSDocumentController sharedDocumentController] addDocument:doc];
[doc updateChangeCount:NSChangeDone]; // mark as dirty
[document showWindows];
--
Brian Stern
email@hidden
_______________________________________________
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.