How to Cancel the parsing of xml that is in the another thread
i want to connect the webservice and parse the xml as it will take time to execute so i done it in a separate thread and show a activity indicator to the user now i also want to insert the cancel option.
Because if the network connection or parsing take long time and user want to abort the processing the user will be able to do this.
so my question is now how can i cancel a thread? the main problem is that the network connection is a separate class and xml parsing is another class and as both are sequentially executing the开发者_JS百科n how can i manage it.
how to cancel network connection or may be it's parsing then how can i abort the parsing and thread.
Thanks
NSURLConnection
returns a connection
handle and you can send the cancel
message to that handle.
[connection cancel];
精彩评论