1

My original app run normally in swift2.3 with xcode 7, but after I convert to swift3.0 with xcode 8, which appear many errors, then I fix it all. I run my swift3 app with no error, but! it crashed in the landing page, with error message

Thread 1: signal SIGABRT in class AppDelegate

when app run in swift2.3 I still have no problem with parse and core data. I also try other solutions such as 1.add all privacy into info.plist files

<key>NSRemindersUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>kTCCServiceMediaLibrary</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSMotionUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSMicrophoneUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSAppleMusicUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSLocationUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSHomeKitUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSHealthUpdateUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSHealthShareUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSContactsUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSCameraUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSCalendarsUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>&quot;Do u allow us to use it?&quot;</string>

2.check all my storyboard about the missing linking issues, still not work out.

reference:

  1. https://forums.developer.apple.com/thread/48959
  2. https://teamtreehouse.com/community/error-message-thread-1-signal-sigabrt-in-class-appdelegate

here is my code:

import UIKit
import CoreData
import Parse
import Bolts

@available(iOS 10.0, *)
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


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

    // [Optional] Power your app with Local Datastore. For more info, go to
    // https://parse.com/docs/ios/guide#local-datastore
    Parse.enableLocalDatastore()

    // Initialize Parse. demo ID and Key
    Parse.setApplicationId("test123456789102293953543545",
        clientKey: "test09987654321234567890987654321")

    // [Optional] Track statistics around application opens.
    PFAnalytics.trackAppOpened(launchOptions: launchOptions)

    // Change the navifation background color
    UINavigationBar.appearance().barTintColor = UIColor(red: 216.0/255.0, green: 51.0/255.0, blue: 29.0/255.0, alpha: 1.0)

    // Change the navigation bar button color
    UINavigationBar.appearance().tintColor = UIColor.white()

    // Change the text font style and color
    if let barFont = UIFont(name: "AvenirNextCondensed-DemiBold", size: 22.0) {
        UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:UIColor.white(), NSFontAttributeName:barFont]
    }

    // Change the status bar appearence
    UIApplication.shared().statusBarStyle = .lightContent

    // Change toolbar style
    // Font color
    // UIBarButtonItem.appearance().tintColor = UIColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 0.5)

    // Background color
    // UIToolbar.appearance().barTintColor = UIColor(red: 237.0/255.0, green: 240.0/255.0, blue: 243.0/255.0, alpha: 0.5)

    // Edit tab bar appearence
    UITabBar.appearance().tintColor = UIColor(red: 216.0/255.0, green: 51.0/255.0, blue: 29.0/255.0, alpha: 1.0)

    UITabBar.appearance().barTintColor = UIColor.black()

    UITabBar.appearance().selectionIndicatorImage = UIImage(named: "tabitem_selected")

    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:.
}


// MARK: - Core Data stack

lazy var applicationDocumentsDirectory: URL = {
    // The directory the application uses to store the Core Data store file. This code uses a directory named "com.jiro9611.CoreDataDemo" in the application's documents Application Support directory.
    let urls = FileManager.default().urlsForDirectory(.documentDirectory, inDomains: .userDomainMask)
    return urls[urls.count-1]
}()

lazy var managedObjectModel: NSManagedObjectModel = {
    // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
    let modelURL = Bundle.main().urlForResource("Zokoma", withExtension: "momd")!
    return NSManagedObjectModel(contentsOf: modelURL)!
}()

lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = {
    // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
    // Create the coordinator and store
    let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
    let url = try! self.applicationDocumentsDirectory.appendingPathComponent("Zokoma.sqlite")
    var failureReason = "There was an error creating or loading the application's saved data."
    do {
        try coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url, options: nil)
    } catch {
        // Report any error we got.
        var dict = [String: AnyObject]()
        dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
        dict[NSLocalizedFailureReasonErrorKey] = failureReason

        dict[NSUnderlyingErrorKey] = error as NSError
        let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
        // Replace this with code to handle the error appropriately.
        // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
        NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)")
        abort()
    }

    return coordinator
}()


lazy var managedObjectContext: NSManagedObjectContext? = {
    // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
    let coordinator = self.persistentStoreCoordinator
    var managedObjectContext = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)

    managedObjectContext.persistentStoreCoordinator = coordinator
    return managedObjectContext
}()

// MARK: - Core Data Saving support

func saveContext () {
    if managedObjectContext!.hasChanges {
        do {
            try managedObjectContext!.save()
        } catch {
            // Replace this implementation with code to handle the error appropriately.
            // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
            let nserror = error as NSError
            NSLog("Unresolved error \(nserror), \(nserror.userInfo)")
            abort()
            }
        }
    }
}

debug console error message (Thread 1 : 12 main)

2016-06-20 17:27:54.918235 testdemo[11372:336115] bundleid: com.jiro9611.testdemo.testdemo, enable_level: 0, persist_level: 0, propagate_with_activity: 0
2016-06-20 17:27:54.919918 testdemo[11372:336148] subsystem: com.apple.UIKit, category: HIDEvents, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-20 17:27:54.967324 testdemo[11372:336115] Created DB, header sequence number = 252
2016-06-20 17:27:55.212898 testdemo[11372:336115] Created DB, header sequence number = 252
2016-06-20 17:27:55.817391 testdemo[11372:336115] subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-20 17:27:55.879995 testdemo[11372:336173] subsystem: com.apple.FrontBoard, category: Common, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-20 17:27:56.123117 testdemo[11372:336315] subsystem: com.apple.network, category: , enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-20 17:27:56.126025 testdemo[11372:336332] subsystem: com.apple.SystemConfiguration, category: SCNetworkReachability, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-20 17:27:56.161570 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.161939 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.162781 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.163424 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.165271 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.166167 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.168272 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.169543 testdemo[11372:336318] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.207060 testdemo[11372:336326] [] nw_endpoint_handler_start [1 api.parse.com:443 initial path (null)]
2016-06-20 17:27:56.207989 testdemo[11372:336326] [] nw_connection_endpoint_report [1 api.parse.com:443 initial path (null)] reported event path:start
2016-06-20 17:27:56.209468 testdemo[11372:336326] [] nw_connection_endpoint_report [1 api.parse.com:443 waiting path (satisfied)] reported event path:satisfied
2016-06-20 17:27:56.212309 testdemo[11372:336326] subsystem: com.apple.SystemConfiguration, category: SCPreferences, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-20 17:27:56.217287 testdemo[11372:336326] [] nw_connection_endpoint_report [1 api.parse.com:443 in_progress resolver (satisfied)] reported event resolver:start_dns
2016-06-20 17:27:56.224829 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 52.86.231.34:443
2016-06-20 17:27:56.225499 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 52.73.71.78:443
2016-06-20 17:27:56.226195 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 54.236.65.43:443
2016-06-20 17:27:56.227043 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 54.175.62.130:443
2016-06-20 17:27:56.228196 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 52.73.46.179:443
2016-06-20 17:27:56.229822 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 54.86.188.151:443
2016-06-20 17:27:56.231173 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 52.72.176.218:443
2016-06-20 17:27:56.232084 testdemo[11372:336325] [] nw_endpoint_resolver_update [1 api.parse.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 52.87.91.226:443
2016-06-20 17:27:56.232605 testdemo[11372:336325] [] nw_connection_endpoint_report [1 api.parse.com:443 in_progress resolver (satisfied)] reported event resolver:receive_dns
2016-06-20 17:27:56.233045 testdemo[11372:336325] [] nw_endpoint_resolver_start_next_child [1 api.parse.com:443 in_progress resolver (satisfied)] starting child endpoint 52.86.231.34:443
2016-06-20 17:27:56.234173 testdemo[11372:336325] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-06-20 17:27:56.236368 testdemo[11372:336325] [] nw_endpoint_resolver_start_next_child [1 api.parse.com:443 in_progress resolver (satisfied)] starting next child endpoint in 250ms
2016-06-20 17:27:56.236919 testdemo[11372:336325] [] nw_endpoint_handler_start [1.1 52.86.231.34:443 initial path (null)]
2016-06-20 17:27:56.237428 testdemo[11372:336325] [] nw_connection_endpoint_report [1.1 52.86.231.34:443 initial path (null)] reported event path:start
2016-06-20 17:27:56.238535 testdemo[11372:336325] [] nw_connection_endpoint_report [1.1 52.86.231.34:443 waiting path (satisfied)] reported event path:satisfied
2016-06-20 17:27:56.238915 testdemo[11372:336325] [] __nwlog_err_simulate_crash_libsystem libsystem simulate crash unavailable, [libsystem_network.dylib: nw_endpoint_get_hostname :: incorrect endpoint type 1]
2016-06-20 17:27:56.239684 testdemo[11372:336325] [] nw_endpoint_get_hostname incorrect endpoint type 1, dumping backtrace:
        [x86_64] libnetcore-805.0.0.2.2
    0   libsystem_network.dylib             0x000000010934c37f __nw_create_backtrace_string + 123
    1   libsystem_network.dylib             0x000000010934e46e nw_endpoint_get_hostname + 75
    2   libnetwork.dylib                    0x00000001095bfbe7 nw_endpoint_proxy_handler_should_use_proxy + 125
    3   libnetwork.dylib                    0x00000001095cd04f nw_endpoint_handler_path_change + 1509
    4   libnetwork.dylib                    0x00000001095cc8a2 nw_endpoint_handler_start + 570
    5   libnetwork.dylib                    0x00000001095e3026 nw_endpoint_resolver_start_next_child + 2050
    6   libdispatch.dylib                   0x00000001090a51e8 _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x00000001090d1dee _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00000001090aca1d _dispatch_queue_serial_drain + 239
    9   libdi
2016-06-20 17:27:56.241435 testdemo[11372:336325] [] nw_connection_endpoint_report [1.1 52.86.231.34:443 in_progress socket-flow (satisfied)] reported event flow:start_connect
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

debug console error message "objc_release!!!!" (Thread 1 : 11 UIApplicationMain)

UIKit`UIApplicationMain:
0x1067c3dec <+0>:   pushq  %rbp
0x1067c3ded <+1>:   movq   %rsp, %rbp
0x1067c3df0 <+4>:   pushq  %r15
0x1067c3df2 <+6>:   pushq  %r14
0x1067c3df4 <+8>:   pushq  %r13
0x1067c3df6 <+10>:  pushq  %r12
0x1067c3df8 <+12>:  pushq  %rbx
0x1067c3df9 <+13>:  pushq  %rax
0x1067c3dfa <+14>:  movq   %rcx, %rbx
0x1067c3dfd <+17>:  movq   %rsi, -0x30(%rbp)
0x1067c3e01 <+21>:  movl   %edi, %r12d
0x1067c3e04 <+24>:  movq   0xeb33e5(%rip), %r13      ; (void *)0x0000000108264d20: objc_retain
0x1067c3e0b <+31>:  movq   %rdx, %rdi
0x1067c3e0e <+34>:  callq  *%r13
0x1067c3e11 <+37>:  movq   %rax, %r14
0x1067c3e14 <+40>:  movq   %rbx, %rdi
0x1067c3e17 <+43>:  callq  *%r13
0x1067c3e1a <+46>:  movq   %rax, %r15
0x1067c3e1d <+49>:  leaq   0xeb1478(%rip), %r13      ; _UIApplicationLinkedOnVersion
0x1067c3e24 <+56>:  movl   (%r13), %eax
0x1067c3e28 <+60>:  testl  %eax, %eax
0x1067c3e2a <+62>:  jne    0x1067c3e3a               ; <+78>
0x1067c3e2c <+64>:  cmpq   $-0x1, 0xeac3c4(%rip)     ; WebKitSetIsClassic + 7
0x1067c3e34 <+72>:  jne    0x1067c3ead               ; <+193>
0x1067c3e36 <+74>:  movl   (%r13), %eax
0x1067c3e3a <+78>:  cmpl   $0x20100, %eax            ; imm = 0x20100 
0x1067c3e3f <+83>:  jb     0x1067c3e65               ; <+121>
0x1067c3e41 <+85>:  callq  0x10739c10c               ; symbol stub for: objc_autoreleasePoolPush
0x1067c3e46 <+90>:  movq   %rax, %r13
0x1067c3e49 <+93>:  movl   %r12d, %edi
0x1067c3e4c <+96>:  movq   -0x30(%rbp), %rsi
0x1067c3e50 <+100>: movq   %r14, %rdx
0x1067c3e53 <+103>: movq   %r15, %rcx
0x1067c3e56 <+106>: callq  0x1067c3ec5               ; _UIApplicationMainPreparations
0x1067c3e5b <+111>: movq   %r13, %rdi
0x1067c3e5e <+114>: callq  0x10739c106               ; symbol stub for: objc_autoreleasePoolPop
0x1067c3e63 <+119>: jmp    0x1067c3e77               ; <+139>
0x1067c3e65 <+121>: movl   %r12d, %edi
0x1067c3e68 <+124>: movq   -0x30(%rbp), %rsi
0x1067c3e6c <+128>: movq   %r14, %rdx
0x1067c3e6f <+131>: movq   %r15, %rcx
0x1067c3e72 <+134>: callq  0x1067c3ec5               ; _UIApplicationMainPreparations
0x1067c3e77 <+139>: movq   0xeb1372(%rip), %rdi      ; UIApp
0x1067c3e7e <+146>: movq   0xe23e2b(%rip), %rsi      ; "_run"
0x1067c3e85 <+153>: callq  *0xeb3355(%rip)           ; (void *)0x0000000108267ac0: objc_msgSend
0x1067c3e8b <+159>: movq   0xeb3356(%rip), %rbx      ; (void *)0x0000000108264d90: objc_release
0x1067c3e92 <+166>: movq   %r15, %rdi
0x1067c3e95 <+169>: callq  *%rbx
0x1067c3e97 <+171>: movq   %r14, %rdi
0x1067c3e9a <+174>: callq  *%rbx
0x1067c3e9c <+176>: xorl   %eax, %eax
0x1067c3e9e <+178>: addq   $0x8, %rsp
0x1067c3ea2 <+182>: popq   %rbx
0x1067c3ea3 <+183>: popq   %r12
0x1067c3ea5 <+185>: popq   %r13
0x1067c3ea7 <+187>: popq   %r14
0x1067c3ea9 <+189>: popq   %r15
0x1067c3eab <+191>: popq   %rbp
0x1067c3eac <+192>: retq   
0x1067c3ead <+193>: leaq   0xeac344(%rip), %rdi      ; _UIApplicationLinkedOnVersionOnce
0x1067c3eb4 <+200>: leaq   0xeb68f5(%rip), %rsi      ; __block_literal_global.1569
0x1067c3ebb <+207>: callq  0x10739c940               ; symbol stub for: dispatch_once
0x1067c3ec0 <+212>: jmp    0x1067c3e36               ; <+74>

debug console error message (Thread 1 : 13 start)

libdyld.dylib`start:
0x1091276bc <+0>: nop    
0x1091276bd <+1>: movl   %eax, %edi
0x1091276bf <+3>: callq  0x1091276f6               ; symbol stub for: exit
0x1091276c4 <+8>: hlt   

debug console error message (Thread 1 : 14 start)

libdyld.dylib`start:
0x1091276bc <+0>: nop    
0x1091276bd <+1>: movl   %eax, %edi
0x1091276bf <+3>: callq  0x1091276f6               ; symbol stub for: exit
0x1091276c4 <+8>: hlt 
Wangdu Lin
  • 913
  • 1
  • 9
  • 19
  • Does your app require any permissions like access to location, photos, etc? If so, are this set up in your plist / project settings? – ff10 Jun 20 '16 at 10:06
  • @ff10 yes, I do need to access user photo library, and I use core data, send email, and share to facebook (if user login in iphone). I add all privacy - option in info.plist, such as below (I add all my setting to my post ): NSRemindersUsageDescription "Do u allow us to use it?" NSPhotoLibraryUsageDescription "Do u allow us to use it?" – Wangdu Lin Jun 20 '16 at 10:09
  • After adding all keys you specified in your question, try adding a privacy keys in info.plist. Scroll through available keys in info.plist and add all the privacy keys, and let me know what happens. –  Jun 21 '16 at 06:46
  • @AlvinVarghese the keys I added are all about privacy keys in info.plist. it have 16 keys related to privacy. Or I add it in the wrong way (my demo post), I just put an string question for user in the value column. – Wangdu Lin Jun 23 '16 at 03:34
  • I have the same error. I've tried adding privacy keys in info.plist but nothing seems to be the solution. My error is related with AFNetworking and AFURLSessionManager. – fdlr Jul 29 '16 at 06:42
  • My solution is that the core data in swift 3 will cause the crash issues. The reason why I can't find the error is because the debug breakpoint function in xcode 8 beta were broken, it didn't stop what I set. So I can't even debugging. After I adjust the core data syntax, the app running is fine for swift 3. – Wangdu Lin Jul 31 '16 at 15:37

2 Answers2

3

Thanks everyone who gave me suggestions, I finally solved the problem that my friend taught me. I share these two solution here hope can help other people who face the similar issues like me.

  1. xcode 8 beta sometime will miss the break point. when we were debugging, we set some breakpoints, but xcode didn't stop at what we set. It turns out the error is at around what we set the breakpoint before, but xcode 8 beta did not stop there...eventually we use the indigenous method to step by step to test my code.

  2. the real error are because of "Core data" the code expression were changed in swift 3.0, more importantly, new way to write core data didn't means it work it out.

For example:

Old way (swfit2.2): It will cause error show on xcode, so u have to change it

let fetchRequest = NSFetchRequest(entityName: "Restaurant")

New way (swift3.0): This is the key mistake i made, i follow others suggestion, change old way to this, and xcode didn't show the error warning, so I just run the app, and it crash!! without any specific error point to this code line, and like i said the xcode 8 deta sometimes can not stop at the break point, so it lead us to find the wrong way.

let fetchRequest: NSFetchRequest<NSFetchRequestResult> = Restaurant.fetchRequest()

The correct new way (swift3.0) This is the right way without warning and workfind when I run the app.

let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Restaurant")

So, here is what my solution, in apple developer forum and few stackoverflow posts , people are have every similar error messages like me, but the solution are all different. Good luck!

Wangdu Lin
  • 913
  • 1
  • 9
  • 19
0

Usually, the Thread 1: signal SIGABRT errors have a message at the end with more indication. In your case, libc++abi.dylib: terminating with uncaught exception of type NSException.

This SO answer says that it could come from a disconnected segue in the storyboard. Sometimes during the migration it happens. Could you have a look there ?

Edit: Sorry, I just saw that you already tested this.

Community
  • 1
  • 1
tsnkff
  • 786
  • 1
  • 7
  • 20
  • Also doing a Clean & Build (and/or) Delete Derived Data sometimes helps. – tsnkff Jun 21 '16 at 21:37
  • @blablalba Yes, I did check all the segue to see it has yellow warning or not. My app run with no error and warning. I did all clean & build then run, still crash. I think the key point is this error message "2016-06-23 11:39:52.576703 testapp[7660:315960] [] nw_endpoint_get_hostname incorrect endpoint type 1, dumping backtrace:" What does it mean nw_endpoint_get_hostname? – Wangdu Lin Jun 23 '16 at 03:40