gpt4 book ai didi

ios - -[UINib initWithNibName :directory:bundle:] 断言失败

转载 作者:行者123 更新时间:2023-11-28 18:11:16 28 4
gpt4 key购买 nike

当我在 View Controller 中触摸 uitextfield 时,我收到以下消息的错误。

消息:

*** Assertion failure in -[UINib initWithNibName:directory:bundle:], /SourceCache/UIKit/UIKit-2380.17/UINib.m:96
2013-08-26 15:58:43.547 Xpointer[1023:907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: (name != nil) && ([name length] > 0)'

这个错误显示并且总是在任何地方崩溃(所有 View Controller )。

最佳答案

我也遇到了同样的崩溃,这很有趣,我忘了传递 Nib 名称。

错误代码:

MyViewController *vc = [[MyViewController alloc] initWithNibName:@"" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
[vc release]

好的代码:

MyViewController *vc = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
[vc release]

关于ios - -[UINib initWithNibName :directory:bundle:] 断言失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18438768/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com