There is a gap in my understanding of blocks and ARC that I would like some help with. I have received a crash report from a tester which originates from an animation completion block. The crash is as follows:

> 
> Exception Type: EXC\_BAD\_ACCESS (SIGSEGV)
> 
> 
> Exception Codes: KERN\_INVALID\_ADDRESS at 0xf0000010
> 
> 
> 

This is happening inside the following animation completion block (using `animateWithDuration:animations:completion:`). I am swapping two view controllers using a temporary variable:

```
{
    [current wasMovedOffScreen];
    PlayerViewController *temp = current;
    current = next;
    next = temp;
}

```

`next = temp;` is the line on which the crash occurs. The duration of the animation is 0.3 seconds.

This code is executed inside a view controller which acts as a container for two other view controllers, used to simulate the user passing through a list of objects, like a navigation controller, but with a number of customisations that meant a navigation controller was not appropriate for me. 

The two child view controllers are called "current" and "next" - as you can guess the current controller displays the current content, and the next one is used to animate in the new item when the user moves through the list.

If I change the block so that `temp` is declared in the implementation (along with `current` and `next`) the crash stops. However it seems unnecessary to me to have to hold a class ivar for something that is by definition local and temporary. 

So, 

* Why is `temp` apparently released by ARC during this process?
* What would be the correct way to implement this? Is there some lifetime qualifier I should add to the block implementation?
* Why could I not reproduce the crash on my own device or in the simulator? Both devices were iPhone 4 running the same version of iOS (5.0.1).