Reputation: 1
I am a newbie in iPhone App development and I have a problem with thread controlling.
I have set two threads:
another does the same [updates another LABEL(LABEL2)] and is (controlled) started & stopped with a button press event:
Button has a TUCHUPINSIDE event, and I am working with iPhone simulator.
It is working fine when the button is pressed normally (slowly), but when double-clicked or continuously clicked on the button and its execution state comes- then the corresponding LABEL2 is being updated faster then its interval.
Why is this happening?
Upvotes: 0
Views: 188
Reputation: 26972
Firstly, don't update any UI on any thread other than the Main Thread, you will have unpredicted results.
Why are you doing this on another thread? Are you just experimenting?
Also, I wouldn't advise using NSThread (neither do Apple). There are many more higher level concurrency API's you can use in objective-C, such as NSOperations, GCD....
Upvotes: 3