• 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: Catching a click during a loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catching a click during a loop


  • Subject: Re: Catching a click during a loop
  • From: Charilaos Skiadas <email@hidden>
  • Date: Mon, 1 Aug 2005 14:37:04 -0500

On Aug 1, 2005, at 10:18 AM, Mark Williams wrote:


On Jul 31, 2005, at 10:13 PM, Charilaos Skiadas wrote:


On Jul 31, 2005, at 11:24 PM, Mark Williams wrote:

Thanks to every one for the help thus far.
I have run into a new problem with the thread now. First off, I am able to cancel the process now that it's on a new thread. That part works. The problem is that while the new thread is working it updates a textfield in a window pretty regularly with file information. This information is getting all garbled as if the text that was there is not being removed even though I do a setStringValue:@" " between each update. How do I fix this?

Are you using setStringValue on the worker thread? All UI update should be done in the main thread. If that is the problem, you have to use NSObject's

Yes, that is what I was doing.


performSelectorOnMainThread:withObject:waitUntilDone:modes:

So it would be something like [textField performSelectorOnMainThread:@selector(setStringValue:) withObject:@"File info string" waitUntilDone:YES modes:???
What goes in the modes?

Read the documentation in NSObject. In particular, there is a version of the meethod without the modes parameter, which is probably the one you want. Honestly, I have no idea what the modes are, though according to the doc they are "run loop modes". You can probably find more about it by reading up about the run loop, if you really want.


Thank you for the information

Mark.


Haris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Catching a click during a loop
      • From: Mark Williams <email@hidden>
References: 
 >Re: Catching a click during a loop (From: Mark Williams <email@hidden>)

  • Prev by Date: Re: CoreData & Bindings: How to make a predicate search a to-many rel ationship
  • Next by Date: Vu-meter
  • Previous by thread: Re: Catching a click during a loop
  • Next by thread: Re: Catching a click during a loop
  • Index(es):
    • Date
    • Thread