-[UINib initWithNibName:directory:bundle:] 中的断言失败 [英] Assertion failure in -[UINib initWithNibName:directory:bundle:]
本文介绍了-[UINib initWithNibName:directory:bundle:] 中的断言失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在视图控制器中触摸 uitextfield 时,我收到以下消息的错误.
I get the error with below message when I touched uitextfield in view controller.
味精:
*** 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)'
此错误显示并始终在任何地方崩溃(所有视图控制器).
This error show and always crash everywhere(all view controller).
推荐答案
我也遇到了同样的崩溃,很有趣,我忘了传递笔尖名称.
I too had the same crash, it was funny, I forgot to pass nib name.
错误代码:
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]
这篇关于-[UINib initWithNibName:directory:bundle:] 中的断言失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文