• 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: how to terminate first AlertPanel when second AlertPanel appears?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to terminate first AlertPanel when second AlertPanel appears?


  • Subject: Re: how to terminate first AlertPanel when second AlertPanel appears?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 14 May 2010 09:48:29 -0700


On May 14, 2010, at 12:13 AM, kirankumar wrote:

I am developing one application in that i want to add device request feature ,for that i am sending a message like "DeviceRequest" .
if this message is send to other pc in that pc it shows one Alert message (NSRunAlertPanel(@"Request",@"Please Disconnect the device",@"ok",@"",nil);
But again i am sending a devicerequest ,at that time first message will display like that only untill i click on Ok button.
my question is i want to terminate the first message when second message appears.

Short answer: there's no way to cancel NSRunAlertPanel or NSAlert without user action.


In general you should ignore or queue up messages that arrive while the runloop is in the NSModalPanelRunLoopMode. (Ignoring is better, since if you queue up a ton of messages, the user gets one alert panel after another with no way to escape.)

If you absolutely have to have an alert panel that you can dismiss automatically, build your own using a nib. It's not hard; NSAlert is just a convenience. But this is IMHO a bad UI because it can confuse the user to have a window disappear right as s/he was about to click in it, possibly causing an accidental click in the window below.

—Jens_______________________________________________

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: 
 >how to terminate first AlertPanel when second AlertPanel appears? (From: kirankumar <email@hidden>)

  • Prev by Date: Re: AsyncUdpSocket: Receiving duplicate UDP Packet
  • Next by Date: Re: TUTORIAL: Generating Unique ID Strings
  • Previous by thread: how to terminate first AlertPanel when second AlertPanel appears?
  • Next by thread: Simple bindings example
  • Index(es):
    • Date
    • Thread