以 NSException (lldb) 类型的未捕获异常终止

用户8080149

我收到一个错误,以 NSException (lldb) 类型的未捕获异常终止。错误就是错误

回溯是

2017-06-11 22:10:04.009 Kenshin_Swift[6073:541383] Unknown class PhotoController in Interface Builder file.
2017-06-11 22:10:04.120 Kenshin_Swift[6073:541383] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fe830f06900> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key PhotoSelect.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001068efd4b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010635821e objc_exception_throw + 48
    2   CoreFoundation                      0x00000001068efc99 -[NSException raise] + 9
    3   Foundation                          0x0000000105c919df -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
    4   UIKit                               0x0000000106eae293 -[UIViewController setValue:forKey:] + 88
    5   UIKit                               0x000000010712279e -[UIRuntimeOutletConnection connect] + 109
    6   CoreFoundation                      0x00000001068949e0 -[NSArray makeObjectsPerformSelector:] + 256
    7   UIKit                               0x0000000107121122 -[UINib instantiateWithOwner:options:] + 1867
    8   UIKit                               0x0000000106eb49c5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
    9   UIKit                               0x0000000106eb52e7 -[UIViewController loadView] + 177
    10  UIKit                               0x0000000106eb561c -[UIViewController loadViewIfRequired] + 201
    11  UIKit                               0x0000000106eb5e70 -[UIViewController view] + 27
    12  UIKit                               0x0000000106f144f3 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 483
    13  UIKit                               0x0000000106f13935 -[UITabBarController transitionFromViewController:toViewController:] + 59
    14  UIKit                               0x0000000106f0f7f6 -[UITabBarController _setSelectedViewController:] + 365
    15  UIKit                               0x0000000106f0f678 -[UITabBarController setSelectedViewController:] + 234
    16  UIKit                               0x0000000106dcd239 +[UIView(Animation) performWithoutAnimation:] + 90
    17  UIKit                               0x0000000106f09c14 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 354
    18  UIKit                               0x0000000106f0ad8e -[UITabBarController viewWillAppear:] + 206
    19  UIKit                               0x0000000106ebb96f -[UIViewController _setViewAppearState:isAnimating:] + 692
    20  UIKit                               0x0000000106ebc07f -[UIViewController __viewWillAppear:] + 147
    21  UIKit                               0x0000000106ebd873 -[UIViewController viewWillMoveToWindow:] + 507
    22  UIKit                               0x0000000106dc3a87 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 621
    23  UIKit                               0x0000000106dd485b -[UIView(Internal) _addSubview:positioned:relativeTo:] + 451
    24  UIKit                               0x0000000106dc30d7 -[UIView(Hierarchy) addSubview:] + 838
    25  UIKit                               0x0000000106d7f7bf -[UIWindow addRootViewControllerViewIfPossible] + 849
    26  UIKit                               0x0000000106d7fc06 -[UIWindow _setHidden:forced:] + 293
    27  UIKit                               0x0000000106d93519 -[UIWindow makeKeyAndVisible] + 42
    28  UIKit                               0x0000000106d0bf8d -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4818
    29  UIKit                               0x0000000106d120ed -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
    30  UIKit                               0x0000000106d0f26d -[UIApplication workspaceDidEndTransaction:] + 188
    31  FrontBoardServices                  0x000000010a55d6cb __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    32  FrontBoardServices                  0x000000010a55d544 -[FBSSerialQueue _performNext] + 189
    33  FrontBoardServices                  0x000000010a55d8cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    34  CoreFoundation                      0x0000000106894761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    35  CoreFoundation                      0x000000010687998c __CFRunLoopDoSources0 + 556
    36  CoreFoundation                      0x0000000106878e76 __CFRunLoopRun + 918
    37  CoreFoundation                      0x0000000106878884 CFRunLoopRunSpecific + 420
    38  UIKit                               0x0000000106d0daea -[UIApplication _run] + 434
    39  UIKit                               0x0000000106d13c68 UIApplicationMain + 159
    40  Kenshin_Swift                       0x0000000105b9f07f main + 111
    41  libdyld.dylib                       0x0000000109dc368d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

照片控制器是

import Foundation
import UIKit
class PhotoController:UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate{
    @IBOutlet weak var myImageView: UIImageView!
    @IBAction func PhotoSelect(_ sender: Any) {
            }

    @IBAction func PhotoSend(_ sender: Any) {
        let myPickerController = UIImagePickerController()
        myPickerController.delegate = self;
        myPickerController.sourceType = UIImagePickerControllerSourceType.photoLibrary

        self.present(myPickerController, animated: true, completion: nil)

    }
    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject])

    {
        myImageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage

        self.dismiss(animated: true, completion: nil)

    }
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        //myImageUploadRequest()
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }



  }

插座就是插座

我阅读了为什么会发生此错误消息。它说当“插座”错误时,会发生此错误。但我不知道如何解决此问题。我看到 PhotoSelect&PhotoSend 的插座有!,但我不明白这是什么意思。我该怎么办?

特里斯坦·比顿

问题是两个插座PhotoSelectPhotoSend您可能不小心将这些创建为@IBOutlet、删除了它们并重新创建为@IBAction

看看他们!旁边有一个这意味着这些插座不再连接。所以当你运行你的应用程序时,你的故事板在你的视图控制器中找不到这些插座,所以它崩溃了。

您需要通过单击 删除这些插座x

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

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

应用程序崩溃“ libc ++ abi.dylib:以类型为NSException(lldb)的未捕获异常终止”

线程1:信号SIGABRT libc ++ abi.dylib:以类型为NSException(lldb)的未捕获异常终止

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

XCode 线程 1:信号 SIGABRT 错误以 NSException (lldb) 类型的未捕获异常终止

以未捕获的 NSException Xcode 类型异常终止

是否以NSException类型的未捕获异常终止?

以未捕获的异常终止:NSException

迅速终止为NSException类型的未捕获异常

Swift:使用NSException类型的未捕获异常终止

在Swift 5中以NSException类型的未捕获异常终止

Swift 2以NSException类型的未捕获异常终止

由于未捕获的异常“NSRangeException”而终止应用程序。libc++abi.dylib:以未捕获的 NSException 类型异常终止

尝试删除子层会导致以 NSException 类型的未捕获异常终止

以NSException类型的未捕获异常终止:尝试从对象中插入nil个对象[1]

终止未捕获的异常类型 NSException 计时器 Swift 崩溃

Swift Firebase通知“ libc ++ abi.dylib:以类型为NSException的未捕获异常终止”

进行自定义UIButton时以NSException类型的未捕获异常终止

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

在UIView的UIButton中添加addTraget。出现错误“终止为NSException类型的未捕获异常”

FBLogin libc ++ abi.dylib:以类型为NSException的未捕获异常终止

因错误libc ++ abi.dylib而崩溃:以NSException类型的未捕获异常终止

应用程序在负载终止时崩溃,并引发了NSException类型的未捕获异常

将Google Places对象保存到Core Data-以NSException错误类型的未捕获异常终止

登录错误libc ++ abi.dylib:以类型为NSException的未捕获异常终止

libc++abi.dylib:以未捕获的 NSException 类型异常终止(集合视图中的错误)

以 std::invalid_argument 类型的未捕获异常终止:stoi:无转换(lldb)

iPhone开发人员错误-libc ++ abi.dylib:以类型为NSException的未捕获异常终止

Swift 2到3迁移错误(libc ++ abi.dylib:以类型为NSException的未捕获异常终止)