Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the "catch" is that dataTask will retain self? Yeah, I agree that capture semantics with closures is a bit complicated to get right.


Yes, dataTask will retain self in spite of the fact that [weak self] is used in the only place where self is explicitly referenced. This is baffling.

After reading the linked article I have come to think that reference counting is not a good fit for a language that mixes object orientation with functional idioms including tons of closures.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: