2011-07-17 8 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'、理由を終了

:「 - [のUIViewController _loadViewFromNibNamed:バンドル:] "RootViewController" ペン先が、 ビュー出口は設定されませんでしたがロードされました。 '

これは、ロードするものがわからないように、RootViewControllerのビューアウトレットを接続するのを忘れたからです。 MainWindowのRootViewControllerがロードされる最初のものです。表示されるビューがわからない場合は、上記のエラーが表示されます。

+0

私はiPhone開発の初心者で、奇妙だと感じています。アプリケーションがうまく動作するので、コントローラビューはメインウィンドウに接続する必要があります。検索バーが追加された後でのみクラッシュします。ところで、私はRootViewControllerで検索バーを接続しました。 – michael

+0

RootViewControllerで検索バーをどのように接続しましたか? Interface Builderの – Cyprian

+0

:SearchBar接続:コントロールをクリックして検索バーをクリックし、File's Ownerに接続します。さらに、検索バーを右クリックし、デリゲートをFile's Ownerに接続します。 – michael