• 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: User interruption
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User interruption


  • Subject: Re: User interruption
  • From: "I. Savant" <email@hidden>
  • Date: Mon, 16 Mar 2009 13:26:33 -0400

On Mon, Mar 16, 2009 at 1:09 PM, Livio Isaia <email@hidden> wrote:
> I have a program searching data on disk for a long while and would like to
> allow the user to stop the searching in any moment. What is the best and
> easy way to do it?
> (In addition, if the user clicks an another application during the search
> and then again on my application, my application doesn't become active.)

  Have you heard of multithreading? If you're targeting Leopard and
above, read about NSOperation / NSOperationQueue. You'll want to do
the searching in a separate thread / operation, which frees the main
runloop (on which your UI depends) to process mouse clicks, update UI
widgets, etc. Clicking the "stop" button would cancel pending
operations.

--
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: 
 >User interruption (From: Livio Isaia <email@hidden>)

  • Prev by Date: Re: case-insensitive NSDictionary
  • Next by Date: Re: case-insensitive NSDictionary
  • Previous by thread: User interruption
  • Next by thread: Garbage Collection, Core Foundation, and the -finalize problem
  • Index(es):
    • Date
    • Thread