gpt4 book ai didi

iphone - 导航点期间出错

转载 作者:行者123 更新时间:2023-12-03 20:32:34 25 4
gpt4 key购买 nike

我创建了一个基于导航的应用程序。在第一个 View 中向我显示饮料列表,在第二个 View 中向我显示饮料的详细信息。一切看起来都不错,但是当我在 (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 方法中导航 View 时,它会向我显示类似的错误

抛出“NSException”实例后调用终止

在行

 [self.navigationController pushViewController:drinkDetailViewController animated:YES];

请帮帮我,为什么会这样?

我的方法代码如下:

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

DrinkDetailViewController *drinkDetailViewController = [[DrinkDetailViewController alloc] initWithNibName:@"DrinkDetailViewController" bundle:nil];
//UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:drinkDetailViewController];

//[self presentModalViewController:drinkDetailViewController animated:YES];

//[self dismissModalViewControllerAnimated:YES];

// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:drinkDetailViewController animated:YES];

[drinkDetailViewController release];

}

当我单击行时,它会向我显示该异常消息。这是项目日志:

2011-08-10 10:18:10.559 DrinkMixer_Shreyash[694:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "DrinkDetailViewController" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44
2 CoreFoundation 0x00d7aef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d7ae6a +[NSException raise:format:] + 58
4 UIKit 0x000c6709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x000c4134 -[UIViewController loadView] + 120
6 UIKit 0x000c400e -[UIViewController view] + 56
7 UIKit 0x000c2482 -[UIViewController contentScrollView] + 42
8 UIKit 0x000d2f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
9 UIKit 0x000d1555 -[UINavigationController _layoutViewController:] + 43
10 UIKit 0x000d27aa -[UINavigationController _startTransition:fromViewController:toViewController:] + 326
11 UIKit 0x000cd32a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
12 UIKit 0x000d4562 -[UINavigationController pushViewController:transition:forceImmediate:] + 932
13 UIKit 0x000cd1c4 -[UINavigationController pushViewController:animated:] + 62
14 DrinkMixer_Shreyash 0x000029bf -[RootViewController tableView:didSelectRowAtIndexPath:] + 191
15 UIKit 0x0008bb68 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
16 UIKit 0x00081b05 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
17 Foundation 0x0079b79e __NSFireDelayedPerform + 441
18 CoreFoundation 0x00da38c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
19 CoreFoundation 0x00da4e74 __CFRunLoopDoTimer + 1220
20 CoreFoundation 0x00d012c9 __CFRunLoopRun + 1817
21 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208
22 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97
23 GraphicsServices 0x00ffa1c4 GSEventRunModal + 217
24 GraphicsServices 0x00ffa289 GSEventRun + 115
25 UIKit 0x00022c93 UIApplicationMain + 1160
26 DrinkMixer_Shreyash 0x00002089 main + 121
27 DrinkMixer_Shreyash 0x00002005 start + 53
28 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)

请帮我解决这个问题。 。 。

最佳答案

iDroid Explorer,在您的 Drink Detail ViewController 类中,您必须将 View 变量连接到 Xib 文件的 View 元素。它必须通过界面构建​​器来完成。

关于iphone - 导航点期间出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7005938/

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