Magic Studio

专心做有逼格的APP!

01 2014 档案

How do I avoid capturing self in blocks when implementing an API?
摘要:Short answerInstead of accessingselfdirectly, you should access it indirectly, from a reference that will not be retained.If you're not using Automatic Reference Counting (ARC), you can do this:__block MyDataProcessor*dp = self;self.progressBlock =^(CGFloat percentComplete){[dp.delegate myAPI:dp 阅读全文

posted @ 2014-01-10 18:51 Mr 布鲁斯 阅读(320) 评论(0) 推荐(0) 编辑

导航

统计信息

点击右上角即可分享
微信分享提示