[英]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.