0
我是CoreMotion
的新用户。我的第一个程序显示了俯仰,滚转和偏航,但崩溃deviceManager
变化值,当它试图设置referenceAttitude
CoreMotion [ViewController updateReferenceAttitude:] - 为什么选择器不被识别?
- (void)updateReferenceAttitude
{
self.refAttitude = self.manager.deviceMotion.attitude;
NSLog(@"you clicked a button that took a 3D snapshot");
}
在调试中,语句在我的方法
[myButton addTarget:self action:@selector(updateReferenceAttitude:) forControlEvents:UIControlEventTouchUpInside];
崩溃,并显示以下
'NSInvalidArgumentException', reason: '-[ViewController updateReferenceAttitude:]: unrecognized selector sent to instance 0x14875a00'
为了测试它,我使用运行iOS 10.3.3的iPhone 5 C的Xcode 8.3.3。
任何人都可以解释为什么这selector
不被识别?