Blocks: Conclusion

The following rules apply to variables used within a block: Global variables are accessible, including static variables that exist within the en...

2013-12-20 16:27:01

阅读数 598

评论数 0

Circular Reference with Blocks

Circular Reference with Blocks If a Block uses an automatic variable of object type with a __strong qualifier, when the Block is copied from the s...

2013-12-19 13:55:50

阅读数 1032

评论数 0

Blocks: __block Variables and Objects

__block Variables and Objects The __block specifier can be used for any type of automatic variable. Let’s see how it is used for an id-type automati...

2013-12-19 11:29:49

阅读数 679

评论数 0

Blocks Capturing Objects

Capturing Objects We saw examples using integer variables. Next, let’s see what will happen when an object is used from a Block. In the next source...

2013-12-19 00:04:10

阅读数 595

评论数 0

Memory Segments for __block Variables

Memory Segments for __block Variables In the previous section, we’ve learned only about Blocks. How about __block variables? When a Block uses a _...

2013-12-18 23:02:14

阅读数 554

评论数 0

Memory Segments for Blocks

Memory Segments for Blocks In the previous sections, we’ve learned that a Block is implemented as an automatic variable of a struct, and the struc...

2013-12-18 21:46:20

阅读数 702

评论数 0

Blocks:Writable Variables

Writable Variables Next we show how variables could be writable in Blocks. We see the two solutions to make variables writable, and start with rev...

2013-12-18 20:20:08

阅读数 556

评论数 0

Blocks:Capturing automatic variables

Capturing automatic variables You’ve learned about Block literals and Block-type variables, and should now understand the “anonymous function” part ...

2013-12-18 18:42:21

阅读数 950

评论数 0

Block type variables

函数返回block时候值得注意 Block type variables As we’ve learned, a Block literal looks the same as a function definition except it has no name and it...

2013-12-18 10:35:08

阅读数 461

评论数 0

Block Literal Syntax

Block Literal Syntax This section shows how to write Block literal. The syntax of Block literal is explained with examples. After reading this, yo...

2013-12-18 10:21:29

阅读数 523

评论数 0

Effective Objective-C 2.0: Item 40: Avoid Retain Cycles Introduced by Blocks

Item 40: Avoid Retain Cycles Introduced by Blocks Referencing the Object Owning Them Blocks can very easily introduce retain cycles if they are no...

2013-12-12 20:41:46

阅读数 997

评论数 0

Effective Objective-C 2.0: Item 39: Use Handler Blocks to Reduce Code Separation

Item 39: Use Handler Blocks to Reduce Code Separation A common paradigm in programming a user interface is to perform tasks asynchronously. In thi...

2013-12-12 15:14:38

阅读数 1136

评论数 0

Effective Objective-C 2.0: Item 38: Create typedefs for Common Block Types

Item 38: Create typedefs for Common Block Types Blocks have an inherent type; that is, they can be assigned to an appropriately typed variable. The ...

2013-12-11 22:20:32

阅读数 851

评论数 0

Effective Objective-C 2.0: Item 37: Understand Blocks

Effective Objective-C 2.0 介绍Blocks的文章,有些论点比较新颖,觉得不错,值得一看

2013-12-11 21:55:51

阅读数 1614

评论数 0

Brief Intro to Blocks 5:Using Blocks

Using Blocks Now that you understand the syntax for coding blocks and some of the key concerns with respect to their semantics and memory management...

2013-11-23 17:29:43

阅读数 589

评论数 0

Brief Intro to Blocks 4:Memory Management with Blocks

Memory Management with Blocks At runtime, a block literal expression is allocated on the stack and thus has the same lifetime as a local variable. A...

2013-11-23 16:52:09

阅读数 589

评论数 0

Brief Intro to Blocks 3: Blocks Are Closures

Blocks Are Closures! As stated earlier in this chapter, a block is an implementation of a closure, a function that allows access to local variables ...

2013-11-23 16:40:39

阅读数 523

评论数 0

Brief Intro to Blocks 2:Block Syntax

Block Syntax One of the most difficult things about learning how to program with blocks is mastering their syntax. This section explains block synta...

2013-11-23 16:05:51

阅读数 538

评论数 0

Brief Intro to Blocks 1:Definition

Blocks Welcome back. Congratulations on making it to this point! So far, you have covered all the fundamental elements of the Objective-C platform....

2013-11-23 12:46:53

阅读数 563

评论数 0

取消 删除