Learn about what an NSOperation is, and how you can create and run them.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4034-introducing-concurrency/lessons/2
Learn about what an NSOperation is, and how you can create and run them.
Hi @samdavies
I have a problem with the NSBlockOperation
.
In the video you are referring to a result property when youâre writing
let summationOperation = NSBlockOperation(block: {
result = 2 + 3
})
But Xcode does not recognize the âresultâ property youâre referring to, I cant find it in the docs as wellâŠ
Any suggestions?
Best,
Eran Artzi
Hi,
The result
property is a variable that has been declared in the outer scope - for example:
var result: Int = 0
let summationOperation = NSBlockOperation(block: {
result = 2 + 3
})
Itâs not a special value or anything - and doesnât represent best practice. Itâs just a demo to get the concept of NSBlockOperation
out quickly.
Hope that helps
sam
OhâŠgot it,
Thanks!
Hi @samdavies Thank you for this tutorial. I have a problem with workspace file. I opened workspace file and clicked playground file inside of it. But it says âNo such module Compressorâ I searched google i do some solutions but it doesnt work anyway.
Hi @ratel,
Can you try selecting the Compressor target and building? The first time you open the workspace you have to build the Compressor library in order that the playground can âseeâ it.
sam
Thank you for quick reply @samdavies ! I have tried as you say but result is same. Also all of challange and demo projects still 2.0 It is hard to refactor
Oh, thatâs a shame - sorry. Not sure what else to suggest.
There is a much improved update in the works, currently being recorded. Iâm not sure on the release date, but it will be fully up-to-date with Swift 3 and include many improvements over this original course.
sam
You guys are awesome! Okay then, no problem. I can try these resources later on.