2016-09-20 1 views
0

Ich habe ein seltsames Problem mit einer App, die perfekt auf iOS arbeitet < 10.IOS 10 Kerndaten executeFetchRequest Abstürze genannt, wenn sie vor insertNewObjectForEntityForName

Nachdem das Telefon auf iOS 10 aktualisiert haben, meine app stürzt ab, wenn ein executeFetchRequest tun vor insertNewObjectForEntityForName.

Es scheint vor allem iPhone6 ​​und höher, die das Problem haben (wurde gesagt, dass iPhone5 ist in Ordnung).

Es ist in dieser Zeile im Code unten Absturz:

NSArray *results = [context executeFetchRequest:fetchRequest error:&error]; 

xcode error picture Diese Methoden gibt mir Kopfschmerzen in 'Scada' Klasse:

+(Scada *)getFirstScada { 
    NSError *error = nil; 
    NSArray *results = [context executeFetchRequest:fetchRequest error:&error]; //Crashing here 

    Scada *retVal = nil; 

    //maybe some check before, to be sure results is not empty 
    if ([results count] == 0) { 
     retVal = nil; 
    } else { 
     retVal = [results firstObject]; 
    } 

    return retVal; 
} 

+ (int)insertNewScada:(NSString *)scadaName HostName:(NSString *)scadaHostName { 
    int returnValue = 0; 

    Scada *newScada = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([Scada class]) inManagedObjectContext:context]; 

    //Configure the new scada object. 
    [newScada setName:scadaName]; 
    [newScada setHostname:[scadaHostName uppercaseString]]; 

    // Save the context. 
    NSError *error = nil; 
    if (![context save:&error]) { 
     NSLog(@"Unresolved error %@, %@", error, [error userInfo]); 
     returnValue = -1; 
    } else { 
     returnValue = 1; 
    } 

    return returnValue; 
} 

Mein Anruf heute sind, wie dies in AppDelegate:

Funktioniert nicht:

Scada *scada = [Scada getFirstScada]; 

Works:

[Scada insertNewScada:@"tmp" HostName:@"T.E.M.P/DELETE"]; 
[Scada removeScada:@"T.E.M.P/DELETE"]; 

Scada *scada = [Scada getFirstScada]; 

Das Crash-Protokoll (alle nicht):

Crashed Thema: 0 Absende-Warteschlange: com.apple.main-Thread

Ausnahmetyp : EXC_BAD_ACCESS (SIGSEGV) Ausnahmecodes:
EXC_I386_GPFLT Ausnahme Hinweis: EXC_CORPSE_NOTIFY

Anwendung 10

Spezifische Informationen: objc_msgSend() Selektor Name: fetchLimit CoreSimulator 303,8 - Gerät: iPhone 6s - Laufzeit: iOS 10.0 (14A345) - Device: iPhone 6s

Themen 0 Crashed :: Dispatch-Warteschlange: com.apple .main-Thread 0
libobjc.A.dylib 0x000000010e19facb objc_msgSend + 11 1 com.novotek.SmartDirect 0x000000010b1d113a + [Scada getFirstScada] + 74 (Scada.m: 120) 2 com.novotek.SmartDirect
0x000000010b1f21fd - [ AppDelegate Anwendung: didFinishLaunchingWithOptions:] + 109 (AppDelegate.m: 36) 3 com.apple.UIKit 0x000000010 c3f968e - [UIApplication _handleDelegateCallbacksWithOptions: isSuspended: restore:] + 290 4 com.apple.UIKit 0x000000010c3fb013 - [UIApplication _callInitializationDelegatesForMainScene: transitionContext:] + 4236 5 com.apple.UIKit 0x000000010c4013b9 - [UIApplication _runWithMainScene: transitionContext: Fertigstellung:] + 1731 6 com.apple.UIKit 0x000000010c3fe539 - [UIApplication workspaceDidEndTransaction:] + 188 7 com.apple.FrontBoardServices 0x000000010feef76b FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24 8 com.apple.FrontBoardServices 0x000000010feef5e4 - [FBSSerialQueue _performNext] + 189 9 com. apple.FrontBoardServices 0x000000010feef96d - [FBSSerialQueue _performNextFromRunLoopSource] + 45 10 com.apple.CoreFoundation 0x000000010e6cd311 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 11 com.apple.Corefoundation 0x000000010e6b259c __CFRunLoopDoSources0 + 556 12 com.apple.CoreFoundation 0x000000010e6b1a86 __CFRunLoopRun + 918 13 com.apple.CoreFoundation 0x000000010e6b1494 CFRunLoopRunSpecific + 420 14 com.apple.UIKit
0x000000010c3fcdb6 - [UIApplication _run] + 434 15 com.apple.UIKit
0x000000010c402f34 UIApplicationMain + 159 16 com.novotek.SmartDirect 0x000000010b1e6d7f Haupt + 111 (main.m: 16) 17 libdyld.dylib 0x000000010f55b68d beginnen + 1

Thread 1: 0 libsystem_kernel.dylib 0x000000010f8875e2 __workq_kernreturn + 10 1 libsystem_pthread.dyl ib 0x000000010f99b578 _pthread_wqthread + 1283 2
libsystem_pthread.dylib 0x000000010f999341 start_wqthread + 13

Thread 2 :: Absendewarteschlange: com.apple.libdispatch-Manager 0
libsystem_kernel.dylib 0x000000010f887efa kevent_qos + 10 1
libdispatch.dylib 0x000000010f506c3b _dispatch_mgr_wait_for_event + 79 2 libdispatch.dylib 0x000000010f500a85 _dispatch_mgr_invoke + 248 3 libdispatch.dylib
0x000000010f500887 _dispatch_mgr_thread + 54

Thema 3: 0 libsystem_pthread.dyl ib 0x000000010f999334 start_wqthread + 0

Gewinde 4: 0 libsystem_kernel.dylib 0x000000010f8875e2 __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x000000010f99b578 _pthread_wqthread + 1283 2
libsystem_pthread.dylib 0x000000010f999341 start_wqthread + 13

Gewinde 5 :: com. apple.uikit.eventfetch-Thread 0
libsystem_kernel.dylib 0x000000010f880f72 mach_msg_trap + 10 1 libsystem_kernel.dylib 0x000000010f8803b3 mach_msg + 55 2
com.apple.CoreFoundation 0x000000010e6b27 b4 CFRunLoopServiceMachPort + 212 3 com.apple.CoreFoundation 0x000000010e6b1c31 __CFRunLoopRun + 1345 4 com.apple.CoreFoundation 0x000000010e6b1494 CFRunLoopRunSpecific + 420 5
com.apple.Foundation 0x000000010dc6c080 - [NSRunLoop (NSRunLoop) RunMode: beforeDate:] + 274 6 com.apple.Foundation 0x000000010dcf3a21 - [NSRunLoop (NSRunLoop) runUntilDate:] + 78 7 com.apple.UIKit 0x000000010ce8896d - [UIEventFetcher thread] + 118 8
com.apple.Foundation 0x000000010dc7bf74 __NSThread__start
+ 1243 9 libsystem_pthread. dylib 0x000000010f99b99d _pthread_body + 131 10 libsystem_pthread.dylib 0x000000010f99b91a _pthread_start + 168 11 libsystem_pthre Anzeige.dylib
0x000000010f999351 thread_start + 13

Gewinde 0 mit X86 Thread-Zustand abgestürzt (64 Bit): Rax: 0x0000000000000000 RBX: 0x0000000000000000 RCX: 0x000000010dff6170 RDX: 0x0000000000000004 RDI: 0x00006000000cf5e0 rsi: 0x000000010c223983 RBP: 0x00007fff54a2e280 RSP: 0x00007fff54a2dbf8
r8: 0x0000000000000070 r9: 0x00006000000cf5e0 r10: 0xbadd7088dd4fbead r11: 0x000000010c223983 r12: 0x00006000001ddc40 r13: 0x00006000000cf5e0 r14: 0x000060000005f710 r15: 0x5e0081f7ad0372c5 rip: 0x000000010e19facb RFL: 0x0000000000010202 cr2: 0x00 0000010bfd9e18 Logische CPU: 0 Fehlercode:
0x00000000 Trap-Nummer: 13

Binary Bilder: 0x10b1cf000 - 0x10b200fff + com.novotek.SmartDirect (2.1.0 - 160.906) < 9C490211-3872-3C30-97F6-FDE317F5A424> /Users/USER/Library/Developer/CoreSimulator/Devices/34113BFD-BEE2-4BEF-B77E-0A7DD14B2C55/data/Containers/Bundle/Application/34D88A3E-8915-4552-AAEC-5F4D2F415983/SmartDirect.app/SmartDirect 0x10b237000 - 0x10b25f707 + dyld_sim (360.22) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/dyld_sim 0x10b2a8000 - 0x10b333fff com.apple.Security (10.0 -? ??) < 71DB299C-DADC-331C-A9D8-1DB136470E89> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Security.framework/Security 0x10b39c000 - 0x10b746fff com.apple.audio.toolbox.AudioToolbox (1,8-1,8) < 811188B5-6E3B-30E2-986E-19C52D09BC51> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ iPhoneSimulator.sdk/System/Bibliothek/Frameworks/AudioToolbox.framework/AudioToolbox 0x10b8ae000 - 0x10bee1fff com.apple.CoreGraphics (2.0 - 1070) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs /iPhoneSimulator.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics 0x10bfbe000 - 0x10c295ff7 + CoreData (752.1) < 38BD041F-73CC-3993-8FB5-BAE51919D9BA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/ Frameworks/CoreData.framework/Coredata 0x10c3db000 - 0x10d282ff7 com.apple.UIKit (1,0 - 1000) < 8E889F15-2893-3D6E-B9DB-D2C7F3EA4CDF> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/ Entwickler/SDKs/iPhoneSimulator.sdk/System/Bibliothek/Frameworks/UIKit.framework/UIKit 0x10dc4b000 - 0x10df31ff3 com.apple.Foundation (6.9 - 1349) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform /Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Foundation.framework/Foundation 0x10e18 4000 - 0x10e552eaf + libobjc.A.dylib (706) < 6726AAD7-2FA9-3AEE-AAFC-8C72CAF72E80> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr /lib/libobjc.A.dylib

+0

Bitte fügen Sie das Absturzprotokoll hinzu und fügen Sie, wenn möglich, einen Ausnahme-Haltepunkt zur App hinzu und teilen Sie uns die Codezeile mit, auf der der Absturz erfolgt. – jrturton

+0

Zusätzliche Zeile, in der ein Absturz auftritt, und hinzugefügte Protokollinformationen. – MichaelO

+0

Dies ist ** nicht ** das Crashprotokoll. – vadian

Antwort

0

Danke für die Hilfe.

Es scheint eine statische Methode zu sein, die zweimal aufgerufen wird und eine Variable neu initialisiert.

Ich habe die Lösung gefunden, während ich nach dem Absturzprotokoll gesucht habe und über Zombie in xcode gestolpert bin ...

Verwandte Themen