On 11 Nov 2012, at 19:03, Quincey Morris <[email protected]> 
wrote:

> On Nov 11, 2012, at 04:09 , Luc Van Bogaert <[email protected]> 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 protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to