nsscreencast / comments

Public comments on NSScreencast.com
0 stars 0 forks source link

NSOperation Dependencies #145

Open subdigital opened 3 years ago

subdigital commented 3 years ago

Written on 08/03/2017 13:55:08

URL: https://nsscreencast.com/episodes/177-nsoperation-dependencies

subdigital commented 3 years ago

originally written by liuyao on 07/16/2015 23:55:12

what do you mean slog is not thread safe ? would you talk something about thread safe?

subdigital commented 3 years ago

originally written by liuyao on 07/20/2015 05:25:51

nslog

subdigital commented 3 years ago

originally written by Derek on 10/14/2015 09:39:52

In your code, you put filterOperation inside the completion block of filterOperation. Wouldn't it be a retain cycle?

subdigital commented 3 years ago

originally written by Derek on 10/14/2015 12:13:03

In your code, you put filterOperation inside the completion block of filterOperation. Wouldn't it be a retain cycle?

subdigital commented 3 years ago

originally written by subdigital on 10/14/2015 12:49:31

Good catch. Because the operation’s completion block only gets released in the operation’s dealloc, this would be a retain cycle. That one should be weakly referenced inside the block.

subdigital commented 3 years ago

originally written by Mohammed M. Ennabah on 10/13/2017 19:54:31

Why didn't you use the main() in ResizeOperation to resize the image as long you don't have a completionHandler? instead, you used execute() with finish().

subdigital commented 3 years ago

originally written by subdigital on 10/13/2017 19:59:08

For consistency. The base class _requires_ you to use `execute()` (see https://github.com/nsscreen.... Doing it this way means all operations are treated the same way. For asynchronous ones, it fits naturally, and for synchronous ones they use the same API, but just inline.

subdigital commented 3 years ago

originally written by Mohammed M. Ennabah on 10/13/2017 20:26:11

gotcha, fatalError("You must override this") because I'm using the subclassed Operation. Thanks

subdigital commented 3 years ago

originally written by Mohammed M. Ennabah on 10/13/2017 20:58:16

Thanks for clarification 👍