nsscreencast / comments

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

Syntax Highlighting with TextKit - NSScreencast #110

Open subdigital opened 3 years ago

subdigital commented 3 years ago

Written on 02/17/2016 11:51:38

URL: https://nsscreencast.com/episodes/208-syntax-highlighting-with-textkit

subdigital commented 3 years ago

originally written by Svein Halvor Halvorsen on 02/22/2016 17:06:10

I don't think you have to do [weak self] in the enumeration block, as it's basically an @noescape block. That is, self is captured, but the call is blocked, and the closure is released immediately after the enumeration is complete, thus avoiding the retain cycle. Or am I missing something?

subdigital commented 3 years ago

originally written by subdigital on 02/22/2016 17:15:51

good catch! I think you're right, [weak self] doesn't seem to be required in this case. I think that self isn't even captured in this case because noescape guarantees that you the block won't be run async either.

subdigital commented 3 years ago

originally written by PLM75 on 04/08/2017 17:28:25

In processEditing(), does it matter if the call to super is at the beginning of the function rather than at the end ?