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]

enter "Bug Error" image description here

  • I tested this part of code above in playground.

  • Did I do anything wrong?

  • What's caused this problem?

  • How to fix this problem?

0

There are 0 answers