为什么总是抛出NSInternalInconsistencynsexceptionn异常

为什么总是抛出NSInternalInconsistencyException异常_百度知道
为什么总是抛出NSInternalInconsistencyException异常
提问者采纳
把AppDelegate.m的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions函数里面的全部注释掉,只留下return YES
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁为什么总是抛出NSInternalInconsistencyException异常_百度知道
为什么总是抛出NSInternalInconsistencyException异常
提问者采纳
把AppDelegate.m的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions函数里面的全部注释掉,只留下return YES
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁的海词问答和网友补充:
相关词典网站:10:52 提问
得到NSInternalInconsistencyException
开发ios应用中,在tableView显示自定义单元的时候出现错误,我是用nibFile连接cell,
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CellForOffers" owner:self options:nil];
cell实现:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *CellIdentifier = @"CellForOffers";
CellForOffers *cell =(CellForOffers *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CellForOffers" owner:self options:nil];
cell = [nib objectAtIndex:0];
appDC * application = [dataArray objectAtIndex:[indexPath row]];
cell.namelbl.text=application.o_
cell.descriptionlbl.text=application.o_
[cell.imageView setImageWithURL:[NSURL URLWithString:application.o_image_url]];
按赞数排序
应该是你的自定义Cell把View作为最外面了,要把TableVIewCell拖过去应该就对 了
在类中添加nib就可以了:
cell = (CellForOffers *)[nib objectAtIndex:0];
其他相似问题
相关参考资料主题 : 为什么总是抛出NSInternalInconsistencyException异常呢,请大大们指点迷津
级别: 新手上路
可可豆: 60 CB
威望: 60 点
在线时间: 3(时)
发自: Web Page
来源于&&分类
为什么总是抛出NSInternalInconsistencyException异常呢,请大大们指点迷津&&&
思路是这样的。我创建一个TabBar的应用(由Empty创建,为了练习对程序整体结构的理解),这个TabBar位于画面底部,有5个TabBar Item分别对应5个不同的ViewController,它们分别是:DatePickerViewController, SingleComponentPickerViewController, DoubleComponentPickerViewController, DependentComponentPickerViewController和CustomPickerViewController。在Application Delegate的didFinishLaunchingWithOptions中分别对5个ViewController和TabBarController进行初始化并将UITabBarController设置为root view controller,代码如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
&&&&self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
&&&&// Override point for customization after application launch.
&&&&// initialize 5 content views.
&&&&DatePickerViewController *datePicker = [[DatePickerViewController alloc] initWithNibName:@&DatePickerViewConroller& bundle:nil];
&&&&SingleComponentPickerViewController *singleComponentPicker = [[SingleComponentPickerViewController alloc] initWithNibName:@&SingleComponentPickerViewController& bundle:nil];
&&&&DoubleComponentPickerViewController *doubleComponentPicker = [[DoubleComponentPickerViewController alloc] initWithNibName:@&DoubleComponentPickerViewController& bundle:nil];
&&&&DependentComponentPickerViewController *dependentComponentPicker = [[DependentComponentPickerViewController alloc] initWithNibName:@&DependentComponentPickerViewController& bundle:nil];
&&&&CustomPickerViewController *customPickerViewController = [[CustomPickerViewController alloc] initWithNibName:@&CustomPickerViewController& bundle:nil];
&&&&self.rootController = [[[UITabBarController alloc] init] autorelease];
&&&&self.rootController.viewControllers = [[NSArray alloc] initWithObjects:datePicker, singleComponentPicker, doubleComponentPicker, dependentComponentPicker, customPickerViewController, nil];
&&&&self.rootController.view.backgroundColor = [UIColor lightGrayColor];
&&&&self.window.backgroundColor = [UIColor blackColor];
&&&&[self.window makeKeyAndVisible];
&&&&return YES;
编译可以正常通过,但是在模拟器执行的时候会抛出NSInternalInconsistencyException, 我仔细和使用Xcode TabBar Template生成的代码对比,没发现有什么问题,debug信息如下: 09:21:55.292 Pickers[264:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle &/Users/towelboy/Library/Application Support/iPhone Simulator/5.0/Applications/-CE3B-4B23-AFA2-DF3130AFCB98/Pickers.app& (loaded)' with name 'DatePickerViewConroller''*** First throw call stack:(0x13bc052 0x154dd0a 0xxxxd8e2c 0xd93a9 0xd95cb 0xf4b89 0xf49bd 0xf2f8a 0xf2d7e 0xf2a22 0xf1d88 0x25a9 0x119d6 0x128a6 0xf8 0x15aa9 0x12a6fa9 0xx12ff390a 0x12f2db4 0x12f2ccb 0x122a7 0x13a9b 0x20a2 0x2015)terminate called throwing an exception请各位大大帮帮小弟,谢谢了。
描述:Xcode的工程文件
(43 K) 下载次数:9
级别: 精灵王
可可豆: 12897 CB
威望: 12897 点
在线时间: 857(时)
发自: Web Page
引用 引用楼主towelboy于 09:40发表的 为什么总是抛出NSInternalInconsistencyException异常呢,请大大们指点迷津 :思路是这样的。我创建一个TabBar的应用(由Empty创建,为了练习对程序整体结构的理解),这个TabBar位于画面底部,有5个TabBar Item分别对应5个不同的ViewController,它们分别是:DatePickerViewController, SingleComponentPickerViewController, DoubleComponentPickerViewController, DependentComponentPickerViewController和CustomPickerViewController。在Application Delegate的didFinishLaunchingWithOptions中分别对5个ViewController和TabBarController进行初始化并将UITabBarController设置为root view controller,代码如下:&pre class=&brush: toolbar: auto-links:&&- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{....... UIViewController *datePicker = [[[DatePickerViewController alloc] initWithNibName:@&DatePickerViewConroller& bundle:nil] autorelease];这行里拼写错误!
级别: 新手上路
可可豆: 44 CB
威望: 44 点
在线时间: 5(时)
发自: Web Page
貌似Xcode 平台不会允许拼写错误的吧~?楼主的异常应该是运行之后抛出的。。。
塵世間,一個迷路小書童。。
级别: 骑士
UID: 89306
可可豆: 1611 CB
威望: 1595 点
在线时间: 205(时)
发自: Web Page
rootController&&好像没有add到window上
级别: 新手上路
可可豆: 44 CB
威望: 44 点
在线时间: 5(时)
发自: Web Page
好吧,我承认,2L 版主说的情况“拼写错误”是存在的。。。冒犯了!!Sorry
塵世間,一個迷路小書童。。
级别: 侠客
可可豆: 482 CB
威望: 482 点
在线时间: 63(时)
发自: Web Page
我觉得应该加上一条:self.windows.rootViewController = self.rootViewC
关注本帖(如果有新回复会站内信通知您)
iPhone5的分辨率? 正确答案:
发帖、回帖都会得到可观的积分奖励。
按"Ctrl+Enter"直接提交
关注CocoaChina
关注微信 每日推荐
扫一扫 浏览移动版

我要回帖

更多关于 consistency 的文章

 

随机推荐