Re: How can modal window pass messages to its parent window?
Re: How can modal window pass messages to its parent window?
- Subject: Re: How can modal window pass messages to its parent window?
- From: Chris Tracewell <email@hidden>
- Date: Mon, 18 Mar 2013 18:01:34 -0700
> On Mar 18, 2013, at 12:15 PM, Chris Tracewell wrote:
>
>> 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.
>
>
> You didn't post what these 'warnings all over the place' are, but it this very much sounds to me like it has nothing to do with modal windows or Xcode versions, but by however you've declared your "MyOwner" property. It sounds like you declared it as an "id" and never imported the header into *the .m* file of your builder window controller.
Seth, you are correct, I did indeed declare it as id. It was a lack of understanding on my part about proper use of #import and @class. I'm moving forward with getting all of my #import statements moved to my .m files (except for subclassed classes) and utilizing @class when necessary in my .h files.
Thanks for the feedback.
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