- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是一名初学者,正在学习 Ray Wenderlich 的 Swift 教程,第 2 部分。
本课的最终代码(我收到错误)在这里:http://cdn5.raywenderlich.com/wp-content/uploads/2014/06/TipCalculator-Demo4.zip
当我通过 Xcode 6.3.2 构建应用程序并在 iOS 模拟器 (iPhone 6) 上运行它时,我收到以下错误消息(对于格式不佳表示抱歉)。
我在 Google 和 StackOverflow 上进行了搜索,似乎人们经常遇到类似的错误,但可以通过转到 View Controller 、检查连接检查器并修复任何标记的连接来修复它(例如,所连接的对象不再存在)。
注意:我的连接检查器中没有任何标志 - 一切看起来都很好,包括 Storyboard 中 resultsTextView 和 Text View 对象之间的连接(请参阅附图)
请告诉我如何解决这个问题 - 谢谢。
---------请参阅最右侧的连接检查器 - 看起来不错!---------
http://i.imgur.com/X6eA05F.png
---------错误信息---------
2015-06-05 17:07:39.866 TipCalculator[4848:128801] * 由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[ setValue:forUndefinedKey:]:此类不是键值编码- 符合关键结果TextView。'*第一次抛出调用堆栈:
(
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
关于ios - NSException 类型的未捕获异常(连接似乎很好) - Wenderlich 教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30677612/
@throw NSException 和 NSException raise 有什么区别?我想知道我应该使用哪一个(有一个合适的用例来使用一个),为什么? 最佳答案 来自 Apple 文档, An i
我有一个基本的登录页面,它采用两个值(用户名和密码),这些详细信息被传递到我的服务器,我在服务器上使用 PHP 解析结果并返回 JSON 数组。 一切正常;我可以正确登录,错误登录时会出现正确的错误警
我在编译代码时收到以下错误。我正在尝试连接到 sqlite 3 数据库,并在将文本输入 UIAlertView 后将其保存到表中,创建一个新列表。非常感谢所有帮助我花了几个小时试图弄清楚为什么会抛出这
我是 swift 编程的新手。所以我试图将滑动手势添加到我的 iOS 应用程序中。但是当我尝试滑动时,它会停止应用程序并说 NSException 被捕获。这是我写的代码。 override func
我开始自学 Swift,我是一个真正的初学者,我正在开发一个计算器应用程序,就像一个入门项目。我一直收到线程错误,它以 NSException 类型的未捕获异常终止。我在几个地方读到这通常是由于 St
我已经通过了 Introduction to Exception Programming Topics for Cocoa .在 Throwing Exceptions 下, 显示了一个异常名称:Fi
我是 Swift 的新手,我正在使用 ObjectMapper 解析我的 JSON,但我希望数据显示在 TableView 中。但是我有一个问题: libc++abi.dylib: terminati
我正在使用mailcore2这都是基于 block 的。通常他们定义这样的操作 SomeMailCoreOp *op = [session getOp]; [op start:^(NSError* e
请帮我解决这个问题我是一个学习者 [Session started at 2011-01-10 14:32:07 +0530.] 2011-01-10 14:32:10.595 balls[963:2
抱歉,恐怕这个问题相当含糊,但我不知道使用正确的术语。也许有人可以编辑它? 我正在尝试弄清楚这个问题是什么 2012-12-23 09:53:36.827 myApp[10768:303] *** -
问题 我正在编写一个 Cocoa 应用程序,我想引发异常,从而使应用程序崩溃。 我的应用程序委托(delegate)中有以下几行: [NSException raise:NSInternalIncon
Swift 应用程序崩溃并给我这个错误。 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException
这个问题在这里已经有了答案: Is it a good practice to subclass from NSException for app-specific exceptions? (1 个回
我在 Swift 应用中使用 Firebase 和 GeoFire 3.0 Cocoapod,用世界各地的标记填充 map 。以下是执行圆形查询以获取 map 上当前显示区域内的标记的代码:
我目前是 Xcode 和 IOS 的新手,我在 Xcode 中打开了一个完成的项目,但是当我尝试运行该项目时,我遇到了这些错误: 2015-12-18 20:05:49.729 Arsene[
我尝试运行我的应用程序,但抛出了异常,在控制台中我得到了这个: 2011-05-05 00:18:50.984 myApp[2906:207] *** Terminating app due to u
我正在使用 Flurry Analytics,它会报告我的应用程序崩溃,效果很好,只是我不知道是哪种方法导致了崩溃。 我正在捕获未捕获的异常,如下所示: { [FlurryAnalytics
我正在调用另一个类的方法,但我不能,并且收到此错误。我搜索了它,但没有找到任何可以解决这个问题的东西。请帮忙。 代码: adres = [adres stringByAppendingString:[
我使用以下方法实现了以下异常处理程序: NSSetUncaughtExceptionHandler(&ExceptionHandler) 处理程序然后使用以下代码调用handleException:
我正在尝试为 iPhone 构建这个小项目,但是当我将其部署到 iOS 模拟器上时,我收到错误“libc++abi.dylib:因未捕获的 NSException 类型异常而终止”。 代码非常简单,如
我是一名优秀的程序员,十分优秀!