iOS - Crash when gesture detected logged by Crashlytics - ios

I set gesture recognizer for my tableView:
let longPress = UILongPressGestureRecognizer(target: self, action: "longPressDetected:")
self.tableView.addGestureRecognizer(longPress)
and when I am trying it, it works fine. I've sent app to beta test and I have several times crash with this log:
Thread : Crashed: com.apple.main-thread
0 IamDJ 4295807340 specialized ProjectDetailViewController.longPressDetected(AnyObject) -> () (ProjectDetailViewController.swift)
1 IamDJ 4295765652 #objc ProjectDetailViewController.longPressDetected(AnyObject) -> () (ProjectDetailViewController.swift)
2 UIKit 6613447472 _UIGestureRecognizerSendTargetActions + 164
3 UIKit 6609423196 _UIGestureRecognizerSendActions + 172
4 UIKit 6607906908 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 784
5 UIKit 6613452556 ___UIGestureRecognizerUpdate_block_invoke898 + 72
6 UIKit 6607640760 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 372
7 UIKit 6607627836 _UIGestureRecognizerUpdate + 2404
8 UIKit 6607898316 -[UIWindow _sendGesturesForEvent:] + 1132
9 UIKit 6607895752 -[UIWindow sendEvent:] + 764
10 UIKit 6607701156 -[UIApplication sendEvent:] + 248
11 UIKit 6607693676 _UIApplicationHandleEventQueue + 5528
12 CoreFoundation 6517671236 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
13 CoreFoundation 6517669848 __CFRunLoopDoSources0 + 540
14 CoreFoundation 6517660888 __CFRunLoopRun + 724
15 CoreFoundation 6516804768 CFRunLoopRunSpecific + 384
16 GraphicsServices 6703693960 GSEventRunModal + 180
17 UIKit 6608130044 UIApplicationMain + 204
18 IamDJ 4296201300 main (AppDelegate.swift:15)
19 libdyld.dylib 6874491064 start + 4
How can I find where is the problem? What's wrong with that longPressDetected method? I've tried this method for last 2 hours and nothing crashed. I am using same device and same iOS version (iPhone 6, iOS 9.1). There is 5% free RAM in one of the logs. Could it be problem with releasing memory? Thanks for any help

Related

Click on button in table cell crash at IBAction ios

I am having three buttons in table view cell when click on button it is crashed strangely in line I am attaching code and crash report please suggest a solution.
Code for button click:
#IBAction func ibaReject(sender: UIButton) {
let notification = notifications[sender.tag]
let notificationHandler = NotificationHandlerFactory.getNotificationHandler(notification)
notificationHandler?.handleNegativeAction(notification,viewController: self)
}
Crash report from crashlytics:
Crashed: com.apple.main-thread
0 Quickride 0x1000c589c specialized NotificationViewController.ibaReject(UIButton) -> () (NotificationViewController.swift)
1 Quickride 0x1000c2d28 #objc NotificationViewController.ibaReject(UIButton) -> () (NotificationViewController.swift)
2 UIKit 0x18d31e7b0 -[UIApplication sendAction:to:from:forEvent:] + 96
3 UIKit 0x18d31e730 -[UIControl sendAction:to:forEvent:] + 80
4 UIKit 0x18d308be4 -[UIControl _sendActionsForEvents:withEvent:] + 452
5 UIKit 0x18d31e01c -[UIControl touchesEnded:withEvent:] + 584
6 UIKit 0x18d31db44 -[UIWindow _sendTouchesForEvent:] + 2484
7 UIKit 0x18d318d8c -[UIWindow sendEvent:] + 2988
8 UIKit 0x18d2e9858 -[UIApplication sendEvent:] + 340
9 UIKit 0x18dad6cb8 __dispatchPreprocessedEventFromEventQueue + 2736
10 UIKit 0x18dad0720 __handleEventQueue + 784
11 CoreFoundation 0x18744e278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
12 CoreFoundation 0x18744dbc0 __CFRunLoopDoSources0 + 524
13 CoreFoundation 0x18744b7c0 __CFRunLoopRun + 804
14 CoreFoundation 0x18737a048 CFRunLoopRunSpecific + 444
15 GraphicsServices 0x188dfd198 GSEventRunModal + 180
16 UIKit 0x18d354628 -[UIApplication _run] + 684
17 UIKit 0x18d34f360 UIApplicationMain + 208
18 Quickride 0x1002d4018 main (AppDelegate.swift:23)
19 libdispatch.dylib 0x18635c5b8 (Missing)

Understanding Swift stacktrace in Crashlytics

So, as a novice IOS developer I find it hard to determine what cases this exception.
Case: the IOS app has a UIScrollView that allows the user to drag down to sync with a web service - just like the build in mail app.
Once in a while a user in the wild will encounter an app crash. In crashlytics i see:
Crashed: com.apple.main-thread: EXC_BREAKPOINT 0x00000000e7ffdefe
0 myApp 0xba760 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
1 myApp 0xba4a0 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
2 myApp 0xb702c #objc WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift)
3 UIKit 0x2cee4ad3 -[UIScrollView _updatePanGesture] + 282
4 UIKit 0x2ced206b _UIGestureRecognizerSendActions + 294
5 UIKit 0x2cd810f9 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 668
6 UIKit 0x2d19af9b ___UIGestureRecognizerUpdate_block_invoke661 + 46
7 UIKit 0x2cd4a181 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 216
8 UIKit 0x2cd4805f _UIGestureRecognizerUpdate + 2926
9 UIKit 0x2cd7f4d9 -[UIWindow _sendGesturesForEvent:] + 784
10 UIKit 0x2cd7eddd -[UIWindow sendEvent:] + 524
11 UIKit 0x2cd54fe5 -[UIApplication sendEvent:] + 196
12 UIKit 0x2cfcb8fb _UIApplicationHandleEventFromQueueEvent + 14414
13 UIKit 0x2cd539f9 _UIApplicationHandleEventQueue + 1352
14 CoreFoundation 0x296c5faf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
15 CoreFoundation 0x296c53bf __CFRunLoopDoSources0 + 218
16 CoreFoundation 0x296c3a25 __CFRunLoopRun + 772
17 CoreFoundation 0x29610201 CFRunLoopRunSpecific + 476
18 CoreFoundation 0x29610013 CFRunLoopRunInMode + 106
19 GraphicsServices 0x30eef201 GSEventRunModal + 136
20 UIKit 0x2cdb4a59 UIApplicationMain + 1440
21 myApp 0x5d084 main (AppDelegate.swift:14)
22 libdyld.dylib 0x37f3daaf start + 2
This is the code from the controller:
func scrollViewWillBeginDragging(scrollView: UIScrollView){
if Settings.isSyncActive {
if let lastSyncDate = Settings.lastSyncedDate { // ln 427
self.refreshControl.attributedTitle = NSAttributedString(string: "Last sync \(lastSyncDate.relativeTimeToString()) ago") // ln 428
} // ln 429
else{
self.refreshControl.attributedTitle = NSAttributedString(string: "")
}
}
}
Any hint or tips are appreciated

Understanding an iOS stacktrace

I'm kinda new to debugging iOS exceptions.
On the fabric.io site I can see that a few users has seen this crash.
Can anyone please help me get started?
Crashed: com.apple.main-thread
0 gismoapp 0x114760 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
1 gismoapp 0x1144a0 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
2 gismoapp 0x11102c #objc WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift)
3 UIKit 0x261b4609 -[UIScrollView(UIScrollViewInternal) _scrollViewWillBeginDragging] + 232
4 UIKit 0x261b3a9d -[UIScrollView _updatePanGesture] + 284
5 UIKit 0x265685db _UIGestureRecognizerSendTargetActions + 142
6 UIKit 0x261a08e3 _UIGestureRecognizerSendActions + 170
7 UIKit 0x26030d15 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1004
8 UIKit 0x2656993f ___UIGestureRecognizerUpdate_block_invoke898 + 62
9 UIKit 0x25ff1587 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 298
10 UIKit 0x25fedaf9 _UIGestureRecognizerUpdate + 2920
11 UIKit 0x2602ec01 -[UIWindow _sendGesturesForEvent:] + 904
12 UIKit 0x2602e3b3 -[UIWindow sendEvent:] + 622
13 UIKit 0x25ffec85 -[UIApplication sendEvent:] + 204
14 UIKit 0x25ffd229 _UIApplicationHandleEventQueue + 5016
15 CoreFoundation 0x219efa67 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
16 CoreFoundation 0x219ef657 __CFRunLoopDoSources0 + 454
17 CoreFoundation 0x219ed9bf __CFRunLoopRun + 806
18 CoreFoundation 0x2193c289 CFRunLoopRunSpecific + 516
19 CoreFoundation 0x2193c07d CFRunLoopRunInMode + 108
20 GraphicsServices 0x22f58af9 GSEventRunModal + 160
21 UIKit 0x260672c5 UIApplicationMain + 144
22 gismoapp 0xb7084 main (AppDelegate.swift:14)
23 libdispatch.dylib 0x215e8873 (Missing)
The code in question:
func scrollViewWillBeginDragging(scrollView: UIScrollView){
if let lastSyncDate = Settings.lastSyncedDate {
// This is line 428 in WeekPlanController
self.refreshControl.attributedTitle = NSAttributedString(string: "last synced \(lastSyncDate.relativeTimeToString()) ago")
}
}

iOS - Can't trace this crash error

I'm using Crashlytics 3.6.0 and I've been getting a couple of crash reports lately that I can't read/understand. They seem to only happen on iOS 8 (can't confirm this 100% though).
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x197fcfbd0 objc_msgSend + 16
1 UIKit 0x18c035c60 -[UIControl _sendActionsForEvents:withEvent:] + 124
2 UIKit 0x18c293e7c -[UISwitch _handleLongPressNL:] + 424
3 UIKit 0x18c1af508 _UIGestureRecognizerSendActions + 276
4 UIKit 0x18c048050 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 580
5 UIKit 0x18c4b420c ___UIGestureRecognizerUpdate_block_invoke662 + 60
6 UIKit 0x18c00c530 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 292
7 UIKit 0x18c00a8dc _UIGestureRecognizerUpdate + 2504
8 UIKit 0x18c0461f8 -[UIWindow _sendGesturesForEvent:] + 1044
9 UIKit 0x18c045898 -[UIWindow sendEvent:] + 660
10 UIKit 0x18c018fa8 -[UIApplication sendEvent:] + 264
11 infinight 0x1003ebe00 -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
12 UIKit 0x18c2b7f58 _UIApplicationHandleEventFromQueueEvent + 14992
13 UIKit 0x18c017510 _UIApplicationHandleEventQueue + 1616
14 CoreFoundation 0x18781e9ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
15 CoreFoundation 0x18781dc90 __CFRunLoopDoSources0 + 264
16 CoreFoundation 0x18781bd40 __CFRunLoopRun + 712
17 CoreFoundation 0x1877490a4 CFRunLoopRunSpecific + 396
18 GraphicsServices 0x1908eb5a4 GSEventRunModal + 168
19 UIKit 0x18c07e3c0 UIApplicationMain + 1488
20 infinight 0x10013af44 main (main.m:16)
21 libdyld.dylib 0x19862aa08 start + 4
Could anyone help me identify the error? I can't reproduce the error -- it doesn't happen on my device or on the simulator. But I've been getting a fair amount of crash reports like these in the last couple of days from test users.
This was an error that only occured on iOS 8. To reproduce the error, I downloaded the iOS 8.1 simulator and found the error. To get the exact error message, I went to Edit Scheme and Enabled Zombie Objects. That showed me the exact error message:
*** -[NamedUISwitch _sendActionsForEvents:withEvent:]: message sent to deallocated instance

UIApplication crash when open the app after few days

Could you help me with this mysterious crash? It happens when I re-open the app after a few days, so it's practically impossible to debug it :/
Any clue or idea would be super helpful. I'm kinda lost here. Thank you!
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000196a63bd0 objc_msgSend + 16
1 UIKit 0x000000018ab35418 -[UIApplication sendAction:to:from:forEvent:] + 96
2 UIKit 0x000000018ab1e52c -[UIControl _sendActionsForEvents:withEvent:] + 612
3 UIKit 0x000000018ab34db4 -[UIControl touchesEnded:withEvent:] + 592
4 UIKit 0x000000018ab34a40 -[UIWindow _sendTouchesForEvent:] + 700
5 UIKit 0x000000018ab2df94 -[UIWindow sendEvent:] + 684
6 UIKit 0x000000018ab0168c -[UIApplication sendEvent:] + 264
7 UIKit 0x000000018ada060c _UIApplicationHandleEventFromQueueEvent + 14992
8 UIKit 0x000000018aaffbf4 _UIApplicationHandleEventQueue + 1616
9 CoreFoundation 0x000000018630a9ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
10 CoreFoundation 0x0000000186309c90 __CFRunLoopDoSources0 + 264
11 CoreFoundation 0x0000000186307d40 __CFRunLoopRun + 712
12 CoreFoundation 0x00000001862350a4 CFRunLoopRunSpecific + 396
13 GraphicsServices 0x000000018f3d75a4 GSEventRunModal + 168
14 UIKit 0x000000018ab66aa4 UIApplicationMain + 1488
15 Wiretap 0x000000010012b604 main (main.m:16)
16 libdyld.dylib 0x00000001970bea08 start + 4

Resources