views:

39

answers:

1

I have a background thread that goes off to a server and gets XML which then renders it to a graph.

I have an NSTimer which fires off a request every 5 seconds, what is typically the best way to stop the execution of a thread altogether (if at all possible), I know you can subclass NSInvocationOperation and implement the cancel method, but I dont know what exactly to do, other that put if (hasBeenCancelled) return; statements everywhere throughout the code...

A: 

This link should help you

ULysses
I have read that, but I must admit, I really learn a lot better with an example, but from what Im reading, you must check the isCancelled value peridocially, which is how you would stop your current operations. Correct? In other words, exactly what my original question stated...
Mark
Yes, thats correct. And thats in fact the only way - i mean the only nice one, excluding thread abortion.
ULysses