Re: ^Block statement considered harmful for callbacks?
Re: ^Block statement considered harmful for callbacks?
- Subject: Re: ^Block statement considered harmful for callbacks?
- From: Torsten Curdt <email@hidden>
- Date: Thu, 25 Apr 2013 19:27:14 +0200
> MyWeakRef *weakRef = [MyWeakRef weakRefFromObject:self];
>
> ^() = {
> Foo *wself = [weakRef originalObject];
> // wself may be nil, that's cool because we only want to doStuff if 'self' is still around.
> [wself doStuff];
> }
How is that different from
__typeof__(self) __weak wself = self;
^() = {
[wself doStuff];
}
...or am I missing something from the beginning of the thread?
cheers,
Torsten
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden