• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Display alert sheet when application is not active
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Display alert sheet when application is not active (From: Luc Van Bogaert <email@hidden>)
 >Re: Display alert sheet when application is not active (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Core Data fetch performance
  • Next by Date: Adding UINavBar to split view detail in storyboard?
  • Previous by thread: Re: Display alert sheet when application is not active
  • Next by thread: Core Data fetch performance
  • Index(es):
    • Date
    • Thread