How can modal window pass messages to its parent window?
How can modal window pass messages to its parent window?
- Subject: How can modal window pass messages to its parent window?
- From: Chris Tracewell <email@hidden>
- Date: Mon, 18 Mar 2013 12:15:00 -0700
I have a main window which has a child/auxilary window. When the user presses a button in the UI the main window controller inits the child, assigns itself as the object for the child window's myOwner property and then launches the child window as a modal via NSApp runModalForWindow. This worked fine in XCode 3 but now I'm finally making the leap to XCode 4.6 and converting to ARC and it does not like this semantic because it does not know what class myOwner is when I make method calls to it and thus gives me warnings all over the place. I can't really include the parent header in the child window controller as it is included in the parent window controller. How should I be doing this?
myProductBuilderWindow = [[TKProductBuilderWindowController alloc] initWithWindowNibName:@"ProductBuilder"];
[myProductBuilderWindow setMyOwner:self];
[NSApp runModalForWindow:[myProductBuilderWindow window]];
Basically the main window controller has several properties, mostly arrays, that the child window needs access to to do its specialized work.
CT
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden