线程1:信号SIGABRT Xcode 6.1

Zav*_*vax 1 xcode swift

我正在运行一个应用程序,在AppDelegate类中我得到错误线程1:信号SIGABRT就行说明class AppDelegate: UIResponder, UIApplicationDelegate { The error message says 2014-12-29 18:10:03.687 Iphone App Learning[1160:144441] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Iphone_App_Learning.ViewController 0x7fcd58f0e270> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key TextField.' *** First throw call stack: ( 0 CoreFoundation 0x000000010ad96f35 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010c8dabb7 objc_exception_throw + 45 2 CoreFoundation 0x000000010ad96b79 -[NSException raise] + 9 3 Foundation 0x000000010b1ae7b3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 4 CoreFoundation 0x000000010ace0e80 -[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x000000010b8e7c7d -[UINib instantiateWithOwner:options:] + 1506 6 UIKit 0x000000010b746f98 -[UIViewController _loadViewFromNibNamed:bundle:] + 242 7 UIKit 0x000000010b747588 -[UIViewController loadView] + 109 8 UIKit 0x000000010b7477f9 -[UIViewController loadViewIfRequired] + 75 9 UIKit 0x000000010b747c8e -[UIViewController view] + 27 10 UIKit 0x000000010b666ca9 -[UIWindow addRootViewControllerViewIfPossible] + 58 11 UIKit 0x000000010b667041 -[UIWindow _setHidden:forced:] + 247 12 UIKit 0x000000010b67372c -[UIWindow makeKeyAndVisible] + 42 13 UIKit 0x000000010b61e061 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2628 14 UIKit 0x000000010b620d2c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350 15 UIKit 0x000000010b61fbf2 -[UIApplication workspaceDidEndTransaction:] + 179 16 FrontBoardServices 0x000000010e4672a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16 17 CoreFoundation 0x000000010accc53c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 18 CoreFoundation 0x000000010acc2285 __CFRunLoopDoBlocks + 341 19 CoreFoundation 0x000000010acc2045 __CFRunLoopRun + 2389 20 CoreFoundation 0x000000010acc1486 CFRunLoopRunSpecific + 470 21 UIKit 0x000000010b61f669 -[UIApplication _run] + 413 22 UIKit 0x000000010b622420 UIApplicationMain + 1282 23 Iphone App Learning 0x000000010abb197e top_level_code + 78 24 Iphone App Learning 0x000000010abb19ba main + 42 25 libdyld.dylib 0x000000010d0b4145 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) AppDelegate类看起来像这样`import UIKit

@UIApplicationMain类AppDelegate:UIResponder,UIApplicationDelegate {

var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    return true
}

func applicationWillResignActive(application: UIApplication) {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
Run Code Online (Sandbox Code Playgroud)

} And the view controller looks like this进口的UIKit

class ViewController:UIViewController {

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

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
Run Code Online (Sandbox Code Playgroud)

我在模拟器中对此进行测试这可能不起作用,因为我没有iOS开发人员程序?

Bra*_*ton 14

看起来你与一个不再存在的插座有着挥之不去的联系.也许您删除了之前设置的textField?

在Xcode编辑器中按住/右键单击文件所有者,查找警告三角形.清除它(通过删除连接或重新连接到正确的插座),你可能会很好.

在此输入图像描述