0
import UIKit

var bOpertation = BlockOperation {
    print("this is a operation 1")
}

bOpertation.addExecutionBlock {
    print("this is a operation 2")
}

bOpertation.addExecutionBlock {
    print("this is a operation 3")
}

print(bOpertation.executionBlocks.count) // the count number is correct.


// Q: why I can't get this object what's wrong ?
bOpertation.executionBlocks[0]

在此处输入“错误错误”图像描述

  • 我在操场上测试了上面的这部分代码。

  • 我做错什么了吗?

  • 是什么导致了这个问题?

  • 如何解决这个问题?

4

0 回答 0