0
초기 목록 (tableview)에서 특정 객체를 선택한 후 마스터 뷰 영역에서 새 모달 뷰를 호출해야합니다.iOS : 분할 뷰의 마스터 (루트) 뷰 위에 새 모달 뷰 표시
이 시도 :
//new view init:
clientList *clientListCon = [[clientList alloc] initWithNibName:@"clientList" bundle:nil];
//pushing
[[splitViewController.viewControllers objectAtIndex:0] presentModalViewController:clientListCon animated:YES];
모든 내가 얻을 :
[self 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'
이 경우 clientListCon은 전체 화면 모드로 열립니다. 루트보기 만 다루고 싶습니다. – Razp
UITable은 일반적인 SplitView 선언에서 유래했습니다. - (void) tableView : (UITableView *) tableView didSelectRowAtIndexPath : (NSIndexPath *) indexPath { // 필요 : NSUInteger row = indexPath.row; if (row == 0) { 새로운 모달 컨트롤러를 푸시} } – Razp
다음과 같이 사용할 수 있습니다. [self.navigationController pushViewController : clientListCon animated : YES]; 하지만 탐색 컨트롤러를 사용하지 않고 모달보기를 표시하는 방법을 찾고 있습니다. – Razp