简体   繁体   English

异常:无法识别的选择器发送到实例,在IOS 8中关闭视图控制器

[英]Exception :unrecognized selector sent to instance Dismissing View Controller in IOS 8

I have open another view successfully in current view using the following code 我已使用以下代码在当前视图中成功打开了另一个视图

 OptionsViewController *optionView = [[OptionsViewController alloc] initWithNibName:IS_IPAD()?@"OptionsViewController_ipad":@"OptionsViewController" bundle:nil];

        [self.navigationController presentViewController:optionView animated:YES completion:Nil];

They i'm trying to dismiss current view in OptionsViewController using the following code. 我正在尝试使用以下代码在OptionsViewController关闭当前视图。 But im getting "unrecognized selector sent to instance" and app crashes in IOS 8 but lower version it was working fine . 但是我在IOS 8中收到"unrecognized selector sent to instance"并且应用崩溃的消息,但是较低版本的IOS运行良好。 Please help me how to resolve . 请帮我解决。

Please check below link for exception message http://pastebin.com/R4M3MxmM 请检查以下链接以获取异常消息http://pastebin.com/R4M3MxmM

- (IBAction)cancelOption:(id)sender
    {

        [self dismissViewControllerAnimated:YES completion:Nil];
    }

The trace says your problem is in [LeftSideBarViewController tableView:numberOfRowsInSection:] . 跟踪显示您的问题在[LeftSideBarViewController tableView:numberOfRowsInSection:] Apparently, you're asking for the count of something but that thing is currently a UITraitCollection which, I'm guessing, is not what you expect. 显然,您是在请求某事物的count ,但是该事物当前是UITraitCollection ,我猜这不是您所期望的。

The most likely explanation is that the thing you're trying to count has been released and its memory reused. 最可能的解释是您要计数的事物已被释放,并且其内存已被重用。

If it's not obvious from that, run Instruments with zombies enabled and look at the retain/release history of the object involved. 如果这样做不明显,请运行启用了僵尸的Instruments,然后查看所涉及对象的保留/释放历史记录。 (Or post the code from the crashing method.) (或通过崩溃方法发布代码。)

:count on the object doesn't exist. :count上的对象不存在。

https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITraitSet_ClassReference/index.html https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITraitSet_ClassReference/index.html

UITraitCollection has no instance method called count . UITraitCollection没有称为count的实例方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法识别的选择器发送到iOS7中的实例异常 - unrecognized selector sent to instance exception in iOS7 引发iOS异常:无法识别的选择器已发送到实例 - iOS Exception was thrown: unrecognized selector sent to instance 无法识别的选择器已发送到实例ios - unrecognized selector sent to instance ios 自定义表视图控制器因“ initWithCoder:无法识别的选择器发送到实例”而崩溃 - Custom Table View Controller crashes with “initWithCoder: unrecognized selector sent to instance” 如何捕获发送到实例异常的无法识别的选择器? - How to catch unrecognized selector sent to instance exception? “无法识别的选择器发送到实例”异常错误 - "unrecognized selector sent to instance" exception error 无法识别的选择器发送到实例defaultRepresentation iOS 8 - unrecognized selector sent to instance defaultRepresentation ios 8 iOS类别属性无法识别的选择器已发送到实例 - iOS category property unrecognized selector sent to instance iOS App崩溃-无法识别的选择器发送到实例 - IOS App crashes - unrecognized selector sent to instance iOS 8: - [UITableViewWrapperView textField]:发送到实例的无法识别的选择器 - iOS 8: -[UITableViewWrapperView textField]: unrecognized selector sent to instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM