NSOperation on the iPhone

前端 未结 7 647
攒了一身酷
攒了一身酷 2020-11-28 19:54

I\'ve been looking for some concrete scenarios for when NSOperation on the iPhone is an ideal tool to use in an application. To my understanding, this is a wrap

7条回答
  •  旧巷少年郎
    2020-11-28 20:17

    A sample that you can try using Swift

    let operation : NSOperation = NSOperation()
    operation.completionBlock = {
    println("Completed")
    }
    
    let operationQueue = NSOperationQueue.mainQueue()
    operationQueue.addOperation(operation)
    

提交回复
热议问题