Re: Display alert sheet when application is not active
Re: Display alert sheet when application is not active
- Subject: Re: Display alert sheet when application is not active
- From: Luc Van Bogaert <email@hidden>
- Date: Mon, 12 Nov 2012 09:56:33 +0100
On 11 Nov 2012, at 19:03, Quincey Morris <email@hidden> wrote:
> On Nov 11, 2012, at 04:09 , Luc Van Bogaert <email@hidden> wrote:
>
>> However, when my application is not active when the file is dropped, the message to the windowcontroller is never sent.
>>
>> Here's the relevant line of code in performDragOperation:
>>
>> [[[[[NSDocumentController sharedDocumentController] currentDocument] windowControllers] objectAtIndex:0]
>> alertImageDragInDesignWithURL:[NSURL URLFromPasteboard:pboard]];
>
> Is this line being executed and "the message to the windowcontroller is never sent", or is this line not executed?
>
> I'd assume the former, and guess it's not being sent because "currentDocument" is nil when you app isn't active.
>
> It seems an odd, haphazard way to find the window controller. Why not '[self.window.windowController alertImageDragInDesignWithURL:[NSURL URLFromPasteboard:pboard]]'?
>
>
Indeed, the former. Thanks (again) for reminding me about the obvious method to find the windowcontroller.
This also solves the problem of the app not being active when dropping a file on the view and displaying an alert.
--
Luc Van Bogaert
_______________________________________________
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