Re: __block __weak - am I doing this right?
Re: __block __weak - am I doing this right?
- Subject: Re: __block __weak - am I doing this right?
- From: Matt Neuburg <email@hidden>
- Date: Mon, 20 Feb 2012 10:11:49 -0800
On Sat, 18 Feb 2012 16:45:56 -0800, Greg Parker <email@hidden> said:
>Precisely. clang now warns about this case (or will soon; I don't know which release of Xcode has this).
>
>test.m:9:33: warning: variable 'x' is uninitialized when captured by block [-Wuninitialized]
> id x = [Foo methodWithBlock:^{ return x; }];
Yes, the static analyzer catches that now (even in an Xcode as old as Snow Leopard Xcode 4.2). That was a *huge* help to me in arriving at the correct formulation. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
_______________________________________________
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