NSException 类型的未捕获异常(连接似乎很好)- Wenderlich 教程

uncaught exception of type NSException (connections seem fine) - Wenderlich tutorial

我是初学者,正在学习 Ray Wenderlich 的 Swift 教程,第 2 部分。

本课的最终代码(以及我收到的错误)在这里:http://cdn5.raywenderlich.com/wp-content/uploads/2014/06/TipCalculator-Demo4.zip

当我通过 Xcode 6.3.2 和 运行 在 iOS 模拟器 (iPhone 6) 上构建应用程序时,我收到以下错误消息 (抱歉格式不正确)。

我在 Google 和 Whosebug 上都进行了搜索,似乎人们经常 运行 遇到类似的错误,但能够通过转到视图控制器、检查连接检查器以及修复任何被标记的连接(例如,连接到的对象不再存在)。

注意: 我的 Connections Inspector 中没有任何标记——那里的一切看起来都很好,包括 Storyboard 中 resultsTextView 和 Text View 对象之间的连接(请参阅附照片)

请告诉我如何解决这个问题 - 谢谢。

--------请参阅最右侧的连接检查器 - 看起来不错!------------

http://i.imgur.com/X6eA05F.png

------------错误信息--------

2015-06-05 17:07:39.866 TipCalculator[4848:128801] * 由于未捕获的异常 'NSUnknownKeyException' 而终止应用程序,原因:'[ setValue:forUndefinedKey :]:此 class 不符合键 resultTextView 的键值编码。 * 首先抛出调用堆栈:

(
0   CoreFoundation                      0x0000000100216c65 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000101d81bb7 objc_exception_throw + 45
2   CoreFoundation                      0x00000001002168a9 -[NSException raise] + 9
3   Foundation                          0x0000000100634b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4   CoreFoundation                      0x000000010015ed50 -[NSArray makeObjectsPerformSelector:] + 224
5   UIKit                               0x0000000100d8d52b -[UINib instantiateWithOwner:options:] + 1506
6   UIKit                               0x0000000100be5718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7   UIKit                               0x0000000100be5d08 -[UIViewController loadView] + 109
8   UIKit                               0x0000000100be5f79 -[UIViewController loadViewIfRequired] + 75
9   UIKit                               0x0000000100c1601b -[UINavigationController _layoutViewController:] + 44
10  UIKit                               0x0000000100c16565 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
11  UIKit                               0x0000000100c16664 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
12  UIKit                               0x0000000100c17448 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
13  UIKit                               0x0000000100c17f0e -[UINavigationController __viewWillLayoutSubviews] + 43
14  UIKit                               0x0000000100d62715 -[UILayoutContainerView layoutSubviews] + 202
15  UIKit                               0x0000000100b35a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
16  QuartzCore                          0x0000000104916ec2 -[CALayer layoutSublayers] + 146
17  QuartzCore                          0x000000010490b6d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18  QuartzCore                          0x000000010490b546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
19  QuartzCore                          0x0000000104877886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
20  QuartzCore                          0x0000000104878a3a _ZN2CA11Transaction6commitEv + 462
21  UIKit                               0x0000000100ab3a2d -[UIApplication _reportMainSceneUpdateFinished:] + 44
22  UIKit                               0x0000000100ab46f1 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2648
23  UIKit                               0x0000000100ab30d5 -[UIApplication workspaceDidEndTransaction:] + 179
24  FrontBoardServices                  0x00000001038915e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
25  CoreFoundation                      0x000000010014a41c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
26  CoreFoundation                      0x0000000100140165 __CFRunLoopDoBlocks + 341
27  CoreFoundation                      0x000000010013f947 __CFRunLoopRun + 887
28  CoreFoundation                      0x000000010013f366 CFRunLoopRunSpecific + 470
29  UIKit                               0x0000000100ab2b42 -[UIApplication _run] + 413
30  UIKit                               0x0000000100ab5900 UIApplicationMain + 1282
31  TipCalculator                       0x000000010002c177 main + 135
32  libdyld.dylib                       0x00000001024d9145 start + 1
33  ???                                 0x0000000000000001 0x0 + 1
)

libc++abi.dylib: 以 NSException 类型的未捕获异常终止 (lldb)

确保您正确执行了这些步骤:

Open Main.storyboard and select your View Controller in the Document Outline. Open the Connections Inspector (6th tab), and you will see all of the properties you created listed in the Outlets section. 021_ConnectionsInspector You’ll notice a small circle to the right of resultsTextView. Control-drag from that button down to the text view below the Calculate button, and release to connect your Swift property to this view.

我相信您错过了在此步骤中创建的 @IBOutlet