摘要: Blocks的申明与调用话说Blocks在方法内使用还是挺方便的,之前都是把相同的代码封装成外部函数,然后在一个方法里需要的时候调用,这样挺麻烦的。使用Blocks之后,我们可以把相同代码在这个方法里封装起来,然后再在这个方法中需要的地方直接调用,逻辑清晰,操作也不会那么繁琐。上代码://在方法体内//block申明与初始化 void(^removePicViewBlock)(int,int) = ^(int start,int stop){ while (start <= stop) { NSAutoreleasePool *pool = [[NSAutorelea... 阅读全文
posted @ 2013-03-25 15:32 Asial 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1.NSNotificationCenter. This is anonymous one-to-many communication. Object A posts a notification to the NSNotificationCenter, which then distributes it to any other objects listening for that notification, including Object B. A and B do not have to know anything about each other, so this is a very 阅读全文
posted @ 2013-03-25 15:24 Asial 阅读(157) 评论(0) 推荐(0) 编辑