i use now both but i’m not sure which is better. what is exactly the difference? fuzzy question i know. preparing for wwdc
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sending a
cancelAllOperationsmessage to an operation queue cancels all the operations in that queue (that is, it tells the operations to cancel), whereascancelPreviousPerformRequestsWithTarget:tells the target object to cancel all delayed performs it had previously been told to do.There is no “better” here; the two methods are incomparable. One cancels NSOperations; the other cancels delayed-perform requests. Which cancellation you use depends entirely on whether you made an NSOperation and put it an NSOperationQueue or sent a delayed-perform request.