> On May 2, 2016, at 11:30 AM, Steve Mills wrote:
>
> On May 02, 2016, at 12:58 PM, John McCall wrote:
>
> > You don't have to declare something with __block just to use it in a block.
> > __block specifically means that the variable will be captured *by
> > reference* in the block, meaning t
On May 02, 2016, at 12:58 PM, John McCall wrote:
You don't have to declare something with __block just to use it in a block.
__block specifically means that the variable will be captured *by reference* in
the block, meaning that changes to the variable within the block are visible in
the orig
> On May 2, 2016, at 10:38 AM, Steve Mills wrote:
> I'm working on a project that's had to support older hardware/software until
> now, so we can *finally* convert to ARC. Since it's been almost a year since
> I've worked on anything that used ARC, I'm a little rusty on some of the
> stranger s
On May 02, 2016, at 12:45 PM, Steve Mills wrote:
I'm working on a project that's had to support older hardware/software until
now, so we can *finally* convert to ARC. Since it's been almost a year since
I've worked on anything that used ARC, I'm a little rusty on some of the
stranger stuff, l
I'm working on a project that's had to support older hardware/software until
now, so we can *finally* convert to ARC. Since it's been almost a year since
I've worked on anything that used ARC, I'm a little rusty on some of the
stranger stuff, like __unsafe_retained. Here's a pared down hunk bef
On Jan 26, 2012, at 10:45 PM, Roland King wrote:
>
> On Jan 27, 2012, at 10:04 AM, Marco Tabini wrote:
>
>> On 2012-01-26, at 6:09 PM, Jeff Kelley wrote:
>>
>>> Without ARC, you would use __block to prevent the block from retaining the
>>> object and causing the retain cycle. With ARC, however
On Jan 27, 2012, at 10:04 AM, Marco Tabini wrote:
> On 2012-01-26, at 6:09 PM, Jeff Kelley wrote:
>
>> Without ARC, you would use __block to prevent the block from retaining the
>> object and causing the retain cycle. With ARC, however, the object is
>> retained when you put it into the variab
On Jan 26, 2012, at 6:04 PM, Marco Tabini wrote:
> On 2012-01-26, at 6:09 PM, Jeff Kelley wrote:
>> Without ARC, you would use __block to prevent the block from retaining the
>> object and causing the retain cycle. With ARC, however, the object is
>> retained when you put it into the variable, so
On 2012-01-26, at 6:09 PM, Jeff Kelley wrote:
> Without ARC, you would use __block to prevent the block from retaining the
> object and causing the retain cycle. With ARC, however, the object is
> retained when you put it into the variable, so to avoid a retain cycle, you
> have to declare it l
On Jan 27, 2012, at 6:44 AM, Conrad Shultz wrote:
> On 1/26/12 1:51 PM, Jan E. Schotsman wrote:
>>
>>
>
> The block normally would retain variables it captures from its scope,
> including, in this case, myController. Presumably myController would
> retain the completionHandler block, ergo a r
Hi,
> So, when myController is nil'ed out, ARC releases it, and it releases
> the block in turn. No leaks/abandoned memory.
>
> A special form of this is the idiom:
>
> __block id mySelf = self;
>
> ^{
> [mySelf doSomething];
> }
Wouldn't using __weak instead of __block be better and cleare
On 1/26/12 4:21 PM, Kyle Sluder wrote:
> On Thu, Jan 26, 2012 at 2:44 PM, Conrad Shultz
> wrote:
>> However, __block variables are NOT retained automatically by a block
>> during capture, so this breaks the retain cycle.
>
> __block variables *are* retained under ARC:
> http://clang.llvm.org/docs
On Thu, Jan 26, 2012 at 2:44 PM, Conrad Shultz
wrote:
> However, __block variables are NOT retained automatically by a block
> during capture, so this breaks the retain cycle.
__block variables *are* retained under ARC:
http://clang.llvm.org/docs/AutomaticReferenceCounting.html#misc.blocks
The i
On Jan 26, 2012, at 2:44 PM, Conrad Shultz wrote:
> However, __block variables are NOT retained automatically by a block
> during capture, so this breaks the retain cycle.
This is not true under ARC, where __block variables also retain.
--
David Duncan
__
Without ARC, you would use __block to prevent the block from retaining the
object and causing the retain cycle. With ARC, however, the object is retained
when you put it into the variable, so to avoid a retain cycle, you have to
declare it like so:
__unsafe_unretained __block MyViewCont
On Jan 26, 2012, at 1:51 PM, Jan E. Schotsman wrote:
> This code is given in the "Transitioning to ARC Release Notes" as an example
> of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
> // ...
> myController.completionHand
On Jan 26, 2012, at 3:51 PM, Jan E. Schotsman wrote:
> This code is given in the "Transitioning to ARC Release Notes" as an example
> of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
> // ...
> myController.completionHan
On 2012-01-26, at 3:51 PM, Jan E. Schotsman wrote:
> Hello,
>
> This code is given in the "Transitioning to ARC Release Notes" as an example
> of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
> // ...
> myController.com
On 26 Jan 2012, at 3:51 PM, Jan E. Schotsman wrote:
> This code is given in the "Transitioning to ARC Release Notes" as an example
> of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
There is a MyViewController object n
On Jan 26, 2012, at 1:51 PM, Jan E. Schotsman wrote:
> Supposedly this avoids a retain cycle. But where is the cycle? At least two
> objects are needed for a cycle. What is the second one?
The block. When a block is copied (which it has to be, in order to be called
later after the calling func
On 1/26/12 1:51 PM, Jan E. Schotsman wrote:
> Hello,
>
> This code is given in the "Transitioning to ARC Release Notes" as an
> example of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
> // ...
> myController.completionHa
Le 26 janv. 2012 à 22:51, Jan E. Schotsman a écrit :
> Hello,
>
> This code is given in the "Transitioning to ARC Release Notes" as an example
> of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
> // ...
> myController.
On Jan 26, 2012, at 1:51 PM, Jan E. Schotsman wrote:
> Hello,
>
> This code is given in the "Transitioning to ARC Release Notes" as an example
> of accomodating blocks in an ARC environment:
>
> __block MyViewController *myController = [[MyViewController alloc] init…];
> // ...
> myController.c
Hello,
This code is given in the "Transitioning to ARC Release Notes" as an
example of accomodating blocks in an ARC environment:
__block MyViewController *myController = [[MyViewController alloc]
init…];
// ...
myController.completionHandler = ^(NSInteger result) {
[myController dism
24 matches
Mail list logo