- iOS webView 怎么缓存
- 开发者账号的 personal team 创建的 bundle ID 要怎么管理？
- 使用xib autolayout，对父视图进行动画，子视图并不能自动改变布局
- 自今年6月1日开始，所有提交至苹果App Store的应用必须支持IPv6-only标准,这意味着我们要做什么修改吗?
- 阿里百川 ios sign签名算法
- iOS:求一个 年 月 日 时 分 的DatePicker 时间选择器
- iOS 开发中，有没有做自动测试的必要
- tableview cell 中点击某一部分 打开新的view传值问题
Advises the operation object that it should stop executing its task.
This method does not force your operation code to stop. Instead, it updates the object’s internal flags to reflect the change in state. If the operation has already finished executing, this method has no effect. Canceling an operation that is currently in an operation queue, but not yet executing, makes it possible to remove the operation from the queue sooner than usual.
In OS X v10.6 and later, if an operation is in a queue but waiting on unfinished dependent operations, those operations are subsequently ignored. Because it is already cancelled, this behavior allows the operation queue to call the operation’s start method sooner and clear the object out of the queue. If you cancel an operation that is not in a queue, this method immediately marks the object as finished. In each case, marking the object as ready or finished results in the generation of the appropriate KVO notifications.
In versions of OS X prior to 10.6, an operation object remains in the queue until all of its dependencies are removed through the normal processes. Thus, the operation must wait until all of its dependent operations finish executing or are themselves cancelled and have their start method called.
For more information on what you must do in your operation objects to support cancellation, see “Responding to the Cancel Command.”
Available in iOS 2.0 and later.
Related Sample Code