O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Copying and Modification

You may have expected to see 99 printed in the console because in the pulsing example, you were able to successfully modify self.taxiWidth.constant. This has to do with how the block’s execution stack is created. Figure 13-1 shows that the stack has a read-only (italicized) copy of each variable. The values are frozen at the time the block is created.

Image

Figure 13-1 Block context variables

Although the block’s copy of self is not modifiable, the value is still the address for the same aboutViewController object. The properties can still be changed, as can any part of those properties.

For the 99 example, aNumber is not a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required