我正在尝试将 UIButtonTypeDetailDisclosure 添加到视图的底部栏中。
该应用程序正在成功构建,但在运行时我收到以下错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton view]: unrecognized selector sent to instance 0x17dafa00'
*** First throw call stack:
(0x30c1be83 0x3af786c7 0x30c1f7b7 0x30c1e0af... ... 0x3b471ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
在下面找到我的代码:
self.navigationController.toolbarHidden = NO;
UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIButton *_appInfoContactButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[_appInfoContactButton addTarget:self action:@selector(bottomButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
self.toolbarItems = @[space, _appInfoContactButton, space];