1

I've got the following crash report :

Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x00000001000b6b44

0  Spersy                         0x1000b6b44 specialized BL_BaseTabBarController.(setUpTabBar in _D18ECB1BE2DA6194F4E8C8A0FD1C1668)(BL_BaseTabBarController) -> (forSelectedActionSignContainer : UIImageView) -> () (BL_BaseTabBarController.swift)
1  Spersy                         0x1000b3ae0 @objc BL_BaseTabBarController.cameraControllerSelected(BL_BaseTabBarController) -> () -> () (BL_BaseTabBarController.swift:112)
2  UIKit                          0x186050be8 -[UIApplication sendAction:to:from:forEvent:] + 100
3  UIKit                          0x186050b64 -[UIControl sendAction:to:forEvent:] + 80
4  UIKit                          0x186038870 -[UIControl _sendActionsForEvents:withEvent:] + 436
5  UIKit                          0x186050454 -[UIControl touchesEnded:withEvent:] + 572
6  UIKit                          0x186008c0c _UIGestureRecognizerUpdate + 8988
7  CoreFoundation                 0x180e70728 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
8  CoreFoundation                 0x180e6e4cc __CFRunLoopDoObservers + 372
9  CoreFoundation                 0x180e6e8fc __CFRunLoopRun + 928
10 CoreFoundation                 0x180d98c50 CFRunLoopRunSpecific + 384
11 GraphicsServices               0x182680088 GSEventRunModal + 180
12 UIKit                          0x186082088 UIApplicationMain + 204
13 Spersy                         0x1000ed850 main (AppDelegate.swift:19)
14 libdispatch.dylib              0x1809368b8 (Missing)

And propagating to code, user tapps the tabbar button ( i'm using custom tabbar ) :

@IBAction func cameraControllerSelected()
{
    setUpTabBar(forSelectedActionSignContainer: cameraSign)
}

And the following code executes :

private func setUpTabBar ( forSelectedActionSignContainer imageView : UIImageView ) -> Void
{

    var viewControllerIndex = 0

    if ( imageView == feedSign )
    {
        feedSign.hidden = false
        exploreSign.hidden = true
        cameraSign.hidden = true
        chatSign.hidden = true
        profileSign.hidden = true
        viewControllerIndex = 0
    }
    if ( imageView == exploreSign )
    {
        feedSign.hidden = true
        exploreSign.hidden = false
        cameraSign.hidden = true
        chatSign.hidden = true
        profileSign.hidden = true
        viewControllerIndex = 1
    }
    if ( imageView == cameraSign )
    {
        feedSign.hidden = true
        exploreSign.hidden = true
        cameraSign.hidden = false
        chatSign.hidden = true
        profileSign.hidden = true
        viewControllerIndex = 2
    }
    if ( imageView == chatSign )
    {
        feedSign.hidden = true
        exploreSign.hidden = true
        cameraSign.hidden = true
        chatSign.hidden = false
        profileSign.hidden = true
        viewControllerIndex = 3
    }
    if ( imageView == profileSign )
    {
        feedSign.hidden = true
        exploreSign.hidden = true
        cameraSign.hidden = true
        chatSign.hidden = true
        profileSign.hidden = false
        viewControllerIndex = 4
    }


   if ( !shouldDismissTopOrReload(viewControllerAtIndex: viewControllerIndex))
   {
        displayViewController(atIndex: viewControllerIndex)
        signOnScreen = imageView
   }
}

And it appears only on release builds, on debug everything fine. Is an optimising compiler issue? Cause i have the same procedure setUpTabbar() with no arguments. Other functions - such as shouldDismissTopOrReload(viewControllerAtIndex: viewControllerIndex) and displayViewController(atIndex: viewControllerIndex) are reliable, and well-covered by tests. Any ideas? I've got almost 200 crashes!!

Nikita Semenov
  • 2,111
  • 4
  • 18
  • 31
  • Could you put breakpoints inside your `setUpTabBar` method to see which line makes your app crashes ? – Randy May 22 '16 at 15:51
  • @Randy - it's in release app from store, the bug don't reproduce on debug mode – Nikita Semenov May 22 '16 at 16:00
  • You can build and install a release build from Xcode, just change your settings in the scheme you're building with. Note that the debugger won't really work. If you can reproduce your issue in a Release build, you can then turn off optimization for your Release config and see if that fixes the issue. – Charles A. May 22 '16 at 16:53

0 Answers0