Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

55:BlockOperation #59

Open
platojobs opened this issue Oct 25, 2021 · 0 comments
Open

55:BlockOperation #59

platojobs opened this issue Oct 25, 2021 · 0 comments
Assignees
Labels
MobileDevelopment iOS、安卓、Flutter、go

Comments

@platojobs
Copy link
Owner

class ObjectBlockOperation{
    func threadOperation(){
        let operation = BlockOperation(block: {
            [weak self] in self?.worker()
            return
        })
        let queue = OperationQueue()
        queue.addOperation(operation)
        print("threadBlockOperation\(Thread.current)")
    }
    @objc func worker(){
        print("blockoperation")
    }
}

let blockObject = ObjectBlockOperation()
blockObject .threadOperation()
@platojobs platojobs added the MobileDevelopment iOS、安卓、Flutter、go label Oct 25, 2021
@platojobs platojobs self-assigned this Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MobileDevelopment iOS、安卓、Flutter、go
Projects
None yet
Development

No branches or pull requests

1 participant