nsinvocationoperation

'NSInvocationOperation' is unavailable in Xcode 6.1

隐身守侯 提交于 2020-01-02 04:30:11
问题 My code suddenly can't be compiled in Xcode 6.1 (I'm sure it's working in Xcode 6 GM and beta version). It shows the error message: 'NSInvocationOperation' is unavailable My code is: let operation = NSInvocationOperation(target:self, selector:"backgroundRun:", object:self) Can anybody help? Thanks. 回答1: As of Xcode 6.1, NSInvocation is disabled in Swift, therefore, NSInvocationOperation is disabled too. See this thread in Developer Forum Because it's not type-safe or ARC-safe. Even in

'NSInvocationOperation' is unavailable in Xcode 6.1

Deadly 提交于 2019-12-05 09:32:37
My code suddenly can't be compiled in Xcode 6.1 (I'm sure it's working in Xcode 6 GM and beta version). It shows the error message: 'NSInvocationOperation' is unavailable My code is: let operation = NSInvocationOperation(target:self, selector:"backgroundRun:", object:self) Can anybody help? Thanks. As of Xcode 6.1, NSInvocation is disabled in Swift, therefore, NSInvocationOperation is disabled too. See this thread in Developer Forum Because it's not type-safe or ARC-safe. Even in Objective-C it's very very easy to shoot yourself in the foot trying to use it, especially under ARC. Use closures