Re: Swift crash in dispatch_apply
Re: Swift crash in dispatch_apply
- Subject: Re: Swift crash in dispatch_apply
- From: Roland King <email@hidden>
- Date: Tue, 08 Jul 2014 11:03:08 +0800
Why are you making self unowned?
I have no idea. The Swift book (in the chapter "“Resolving Strong Reference Cycles for Closures”) seems to say that this is the correct way to "resolve a strong reference cycle between a closure and a class instance”.
Not quite - it says unowned if the block and self have the same lifetime, else weak. But I don't know it such a strong reference cycle would exist in my case.
Indeed: removing " [unowned self] " also removes the crash.
and may or may not cause a reference cycle. weak worked when I tried it.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden