• 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: Not accepting click on Button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Not accepting click on Button


  • Subject: Re: Not accepting click on Button
  • From: "I. Savant" <email@hidden>
  • Date: Mon, 24 Aug 2009 09:16:51 -0400

On Aug 24, 2009, at 9:14 AM, Nikhil Khandelwal wrote:

In my application, I am running a process for copying files from one location to another. In this I select number of files from panel and then showing a progress bar which shows progress of copying. In this window I have a cancel button to cancel the copying process but clicking on the cancel button does not call the IBAction until the whole process of copying the file completes.
Any one faced same problem ?

You're doing your work in the main run loop (where all UI stuff is handled). The main run loop is blocked until your work completes and the run loop is ready to handle a new event (the button click).


Move your work to a separate thread (if on Leopard, try NSOperation / NSOperationQueue). That way your UI is free to respond to the cancel button (which in turn tells the queue to cancel all pending tasks).

--
I.S.




_______________________________________________

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: 
 >Not accepting click on Button (From: Nikhil Khandelwal <email@hidden>)

  • Prev by Date: Re: scroll automatically if the text is too long
  • Next by Date: Re: scroll automatically if the text is too long
  • Previous by thread: Not accepting click on Button
  • Next by thread: Re: Not accepting click on Button
  • Index(es):
    • Date
    • Thread