我发现的一个最常见的错误是当我在这样的块中引用“self”时:
...
[self someMethodWhichTakesBlock:^() {
self.something = @"something";
}];
...
我应该写的更像是这样:
...
__block MyObject *_self = self;
[self someMethodWhichTakesBlock:^() {
_self.something = @"something";
}];
...
有没有办法通过某种静态代码分析来捕获这些潜在的错误?