iOS:在分割视图中的主(根)视图之上显示新的模式视图

发布于 2024-10-24 08:18:11 字数 2529 浏览 1 评论 0原文

从初始列表(表格视图)中选择特定对象后,我需要在主视图区域中调用新的模式视图。

尝试过这个:

//new view init:
    clientList *clientListCon = [[clientList alloc] initWithNibName:@"clientList" bundle:nil];
//pushing   
 [[splitViewController.viewControllers objectAtIndex:0] presentModalViewController:clientListCon animated:YES];

我得到的只是:

MultipleDetailViews[12997:40b] -[UITableView presentModalViewController:animated:]: unrecognized selector sent to instance 0x584d800
2011-03-18 14:40:51.449 MultipleDetailViews[12997:40b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableView presentModalViewController:animated:]: unrecognized selector sent to instance 0x584d800'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x017035a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x01857313 objc_exception_throw + 44
    2   CoreFoundation                      0x017050bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x01674966 ___forwarding___ + 966
    4   CoreFoundation                      0x01674522 _CF_forwarding_prep_0 + 50
    5   MultipleDetailViews                 0x00008051 -[RootViewController tableView:didSelectRowAtIndexPath:] + 354
    6   UIKit                               0x00a8fb68 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    7   UIKit                               0x00a85b05 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
    8   Foundation                          0x0079779e __NSFireDelayedPerform + 441
    9   CoreFoundation                      0x016e48c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
    10  CoreFoundation                      0x016e5e74 __CFRunLoopDoTimer + 1220
    11  CoreFoundation                      0x016422c9 __CFRunLoopRun + 1817
    12  CoreFoundation                      0x01641840 CFRunLoopRunSpecific + 208
    13  CoreFoundation                      0x01641761 CFRunLoopRunInMode + 97
    14  GraphicsServices                    0x0205a1c4 GSEventRunModal + 217
    15  GraphicsServices                    0x0205a289 GSEventRun + 115
    16  UIKit                               0x00a26c93 UIApplicationMain + 1160
    17  MultipleDetailViews                 0x000069a4 main + 102
    18  MultipleDetailViews                 0x00006935 start + 53
)
terminate called after throwing an instance of 'NSException'

I need to call a new modal view in the master view area after selecting a specific object from the initial list (tableview).

Tried this:

//new view init:
    clientList *clientListCon = [[clientList alloc] initWithNibName:@"clientList" bundle:nil];
//pushing   
 [[splitViewController.viewControllers objectAtIndex:0] presentModalViewController:clientListCon animated:YES];

All I get:

MultipleDetailViews[12997:40b] -[UITableView presentModalViewController:animated:]: unrecognized selector sent to instance 0x584d800
2011-03-18 14:40:51.449 MultipleDetailViews[12997:40b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableView presentModalViewController:animated:]: unrecognized selector sent to instance 0x584d800'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x017035a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x01857313 objc_exception_throw + 44
    2   CoreFoundation                      0x017050bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x01674966 ___forwarding___ + 966
    4   CoreFoundation                      0x01674522 _CF_forwarding_prep_0 + 50
    5   MultipleDetailViews                 0x00008051 -[RootViewController tableView:didSelectRowAtIndexPath:] + 354
    6   UIKit                               0x00a8fb68 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    7   UIKit                               0x00a85b05 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
    8   Foundation                          0x0079779e __NSFireDelayedPerform + 441
    9   CoreFoundation                      0x016e48c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
    10  CoreFoundation                      0x016e5e74 __CFRunLoopDoTimer + 1220
    11  CoreFoundation                      0x016422c9 __CFRunLoopRun + 1817
    12  CoreFoundation                      0x01641840 CFRunLoopRunSpecific + 208
    13  CoreFoundation                      0x01641761 CFRunLoopRunInMode + 97
    14  GraphicsServices                    0x0205a1c4 GSEventRunModal + 217
    15  GraphicsServices                    0x0205a289 GSEventRun + 115
    16  UIKit                               0x00a26c93 UIApplicationMain + 1160
    17  MultipleDetailViews                 0x000069a4 main + 102
    18  MultipleDetailViews                 0x00006935 start + 53
)
terminate called after throwing an instance of 'NSException'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十年九夏 2024-10-31 08:18:11

看起来应该是这样:

[self presentModalViewController:clientListCon animated:YES];

我不知道你如何从提供的代码中获取对 UITableView 的引用。

It seems like it ought to be:

[self presentModalViewController:clientListCon animated:YES];

I have no idea how you are getting a reference to a UITableView from the provided code though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文