Ios NSInvalidArgumentException,原因是reason:&x27-[UIViewController setDetailModal:]
这是我的代码,我正在尝试这样做,页面将移动到下一页。Ios NSInvalidArgumentException,原因是reason:&x27-[UIViewController setDetailModal:],ios,objective-c,uiviewcontroller,Ios,Objective C,Uiviewcontroller,这是我的代码,我正在尝试这样做,页面将移动到下一页。 但其显示错误如下所示: 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UIViewController setDetailModal:]:发送到实例0x9b24ed0的选择器无法识别” 错误是说您的segue的目标是UIViewController,而不是ViewController。在情节提要中,确保在标识检查器中将该控制器的类设置为ViewController。场景由于缺少入口点而无法
但其显示错误如下所示: 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UIViewController setDetailModal:]:发送到实例0x9b24ed0的选择器无法识别”
错误是说您的segue的目标是
UIViewController
,而不是ViewController
。在情节提要中,确保在标识检查器中将该控制器的类设置为ViewController
。场景由于缺少入口点而无法访问,并且没有通过-instanceeviewcontrollerwhithidentifier:进行运行时访问的标识符。什么是DetailModal
?是您的视图控制器的属性。我建议你从一个小写字母开始。我还想将ViewController
重命名为更具描述性的名称。现在它显示为由于未捕获异常“NSInvalidArgumentException”而终止应用程序时出现的错误,原因:'-[\u NSCFConstantString size]:无法识别的选择器发送到实例0x5acc',请再次告诉@Phillip MillsEither您正在对字符串变量(没有该方法)调用size
,或者更可能的是,您正在尝试使用已解除分配的对象。1) 使用断点导航器添加异常断点。2) 在构建方案中启用僵尸。这将为您提供更好的错误消息。
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier]isEqualToString:@"ShowDetails"]){
ViewController *details = [segue destinationViewController];
NSIndexPath *indexpath = [self.tableView indexPathForSelectedRow];
int row = [indexpath row];
details.DetailModal = @[_Title[row],_description[row],_IMAGES[row]];
}}