2011-07-17 2 views
0

RootViewController.xib에 새로운 검색 창을 추가하고 FileOwner와 연결하면 앱이 충돌합니다. 크래시가 발생할 때 스택을보고합니다.XIB 파일에서 수정 후 앱 크래시

2011-07-17 17:12:43.756 TableView[1397:207] *** Terminating app due to uncaught 
exception 'NSInternalInconsistencyException', reason: '-[UIViewController 
_loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the view outlet 
was not set.' 
*** Call stack at first throw: 
(
0 CoreFoundation      0x00dc85a9 __exceptionPreprocess + 185 

1 libobjc.A.dylib      0x00f1c313 objc_exception_throw + 44 

2 CoreFoundation      0x00d80ef8 +[NSException raise:format:arguments:] + 136 

3 CoreFoundation      0x00d80e6a +[NSException raise:format:] + 58 

4 UIKit        0x0036a709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295 

5 UIKit        0x00368134 -[UIViewController loadView] + 120 

6 UIKit        0x004c1dd8 -[UITableViewController loadView] + 80 

7 UIKit        0x0036800e -[UIViewController view] + 56 

8 UIKit        0x003667f5 -[UIViewController nextResponder] + 34 

9 UIKit        0x003874a6 -[UIResponder _containsResponder:] + 41 

10 UIKit        0x00371c4e -[UINavigationController defaultFirstResponder] + 80 

11 UIKit        0x00386647 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 42 

12 UIKit        0x00386663 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 70 

13 UIKit        0x00386406 -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 42 

14 TableView       0x00002a0a -[TableViewAppDelegate application:didFinishLaunchingWithOptions:] + 135 

15 UIKit        0x002b8c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163 

16 UIKit        0x002bad88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439 

17 UIKit        0x002c5617 -[UIApplication handleEvent:withNewEvent:] + 1533 

18 UIKit        0x002bdabf -[UIApplication sendEvent:] + 71 

19 UIKit        0x002c2f2e _UIApplicationHandleEvent + 7576 

20 GraphicsServices     0x01720992 PurpleEventCallback + 1550 

21 CoreFoundation      0x00da9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 

22 CoreFoundation      0x00d09cf7 __CFRunLoopDoSource1 + 215 

23 CoreFoundation      0x00d06f83 __CFRunLoopRun + 979 

24 CoreFoundation      0x00d06840 CFRunLoopRunSpecific + 208 

25 CoreFoundation      0x00d06761 CFRunLoopRunInMode + 97 

26 UIKit        0x002ba7d2 -[UIApplication _run] + 623 

27 UIKit        0x002c6c93 UIApplicationMain + 1160 
28 TableView       0x00002960 main + 102 
29 TableView       0x000028f1 start + 53 
30 ???         0x00000001 0x0 + 1 
) 

terminate called after throwing an instance of 'NSException' 

답변

2

글쎄, 당신이 이미 당신에게 말하고 싶은 것이 무엇인지 당신이 알기를 원하지 않습니다. 때문에 캐치되지 않는 예외 'NSInternalInconsistencyException'응용 프로그램 종료, 이유

-은 "RootViewController"펜촉 그러나 뷰 출구가 설정되지 로드 '[: 다발의 UIViewController 는 _loadViewFromNibNamed]. '

로드 할 항목을 알 수 없도록 RootViewController의 뷰 콘센트를 연결하는 것을 잊었습니다. MainWindow의 RootViewController가로드 될 첫 번째 것이고, 어떤 뷰를 표시해야하는지 모르는 경우 위의 오류가 발생합니다.

+0

나는 아이폰 개발을 처음 접했고 이상하다고 생각한다 : 애플리케이션이 잘 작동하므로 컨트롤러보기가 메인 윈도우에 연결된다. 검색 창을 추가 한 후에 만 ​​충돌합니다. BTW, 나는 RootViewController와 searchbar를 연결했다. – michael

+0

RootViewController에서 검색 창을 무엇으로 연결 했습니까? Interface Builder에서 – Cyprian

+0

: 검색 표시 줄 연결 : 검색 표시 줄을 클릭 한 다음 파일 소유자에게 연결하십시오. 또한 검색 창을 마우스 오른쪽 단추로 클릭하고 대리인을 File 's Owner에 연결합니다. – michael

관련 문제