Steve Gear
Steve Gear

Reputation: 749

how to cancel the background running thread in my iphone app

i wrote like: [self performSelectorInBackground:@selector(backgroundImageLoading) withObject:nil]; to load image background but know i need to stop this when i refresh the view but i don't have any idea how to do

Upvotes: 0

Views: 237

Answers (2)

iOS
iOS

Reputation: 3616

The threads should not be forced to kill. look out the reasons here. It may help you to find the solution.

Upvotes: 0

Ilanchezhian
Ilanchezhian

Reputation: 17478

See NSOperation and NSOperationQueue.

Its also to do the process concurrently as like background thread. Here in NSOperation you have cancel method available to stop the operation.

Upvotes: 1

Related Questions