• 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 00:13:43 -0500


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 performSelectorOnMainThread:withObject:waitUntilDone:modes:
Mark

On Jul 31, 2005, at 8:10 AM, Mark Williams wrote:


Thank you for the link.
I'll read it over and see what I can learn from it. Thanks
Mark.

On Jul 30, 2005, at 11:18 PM, John Stiles wrote:



Just FYI, threading isn't a small tweak. You do need to use a thread in order to solve your problem, but there are a lot of things you need to know first.
You should probably spend an hour or two and read about it before writing too much code:
http://developer.apple.com/documentation/Cocoa/Conceptual/ Multithreading/index.html#//apple_ref/doc/uid/10000057i


(There might be better resources as well; this was one of the best links I could pull up after searching for a minute or two.)


On Jul 30, 2005, at 10:40 PM, Mark Williams wrote:




Ok. I will move it to a new thread. I tried that before and it made no difference before but I must have done it wrong. I think I know where the mistake there was.

Thanks,
Mark.

On Jul 30, 2005, at 8:26 PM, Cameron Hayne wrote:






On 30-Jul-05, at 10:42 PM, Mark Williams wrote:






Ok, well it's not taking the click at all until after the loop finishes.
So I guess I'm wondering what I did wrong in this loop that I cannot click cancel.







It sounds like your loop is in the main thread instead of being on a separate thread. If it were on a separate thread, it wouldn't affect the main thread.


--
Cameron Hayne
email@hidden










_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden











_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40fornextsoft.com


This email sent to email@hidden





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40math.uchicago.edu


This email sent to email@hidden


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
References: 
 >Catching a click during a loop (From: Mark Williams <email@hidden>)
 >Re: Catching a click during a loop (From: Cameron Hayne <email@hidden>)
 >Re: Catching a click during a loop (From: Mark Williams <email@hidden>)
 >Re: Catching a click during a loop (From: Mark Williams <email@hidden>)
 >Re: Catching a click during a loop (From: Cameron Hayne <email@hidden>)
 >Re: Catching a click during a loop (From: Mark Williams <email@hidden>)
 >Re: Catching a click during a loop (From: John Stiles <email@hidden>)
 >Re: Catching a click during a loop (From: Mark Williams <email@hidden>)
 >Re: Catching a click during a loop (From: Mark Williams <email@hidden>)

  • Prev by Date: Re: Sorting NSManagedObjects in an NSTableView
  • Next by Date: Re: Sorting NSManagedObjects in an NSTableView
  • Previous by thread: Re: Catching a click during a loop
  • Next by thread: Hiding a control on MacOS10.2
  • Index(es):
    • Date
    • Thread