iphone - ARC转换: iphone implicit conversion of 'BOOL' (aka 'signed char' ) to 'id' is disallowed with ARC

标签 iphone ios5 automatic-ref-counting

Implicit conversion of 'BOOL' (aka 'signed char') to 'id' is disallowed with ARC

这是我尝试使用自动化工具将某些代码迁移到 ARC 时遇到的错误

[[NSNotificationCenter defaultCenter] addObserver:self  
                                      selector:@selector(vDidFinish)
                                      name:aNotifName
                                      object:NO];

如何确保它符合 ARC 要求?

最佳答案

您应该为第四个参数(通知发送者)使用正确的类型。它需要一个 Objective-C 对象 - 如果您不想指定一个对象,请传递 nil 而不是 NO;后者是 BOOL 类型的文字值。

关于iphone - ARC转换: iphone implicit conversion of 'BOOL' (aka 'signed char' ) to 'id' is disallowed with ARC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7783490/

相关文章:

iphone - 考虑将特殊字符放入 .csv 文件

iphone - 我正在尝试使用 MWFeedParser 显示 MBProgressHUD 的进度

ios - 什么时候在 block 中引用 self 是一个保留周期?

objective-c - 在 ARC 下,使用运行时方法分配给对象类型的 ivar 是否合法/安全?

objective-c - 让 CVDisplayLink + 自动引用计数完美结合

iphone - iOS4 位置跟踪在后台和时间间隔

ios - UICollectionView 椭圆形自定义单元格

iphone - 是否可以在 iPhone 上使用 card.io 捕获姓氏和名字以及到期日期?

iphone - iOS App 在模拟器上运行但不在设备上运行?

iphone - UILabel setText 在 vi​​ewWillAppear 中不起作用