模态segue旋转时崩溃

时间:2015-04-23 12:31:55

标签: ios swift rotation modalviewcontroller uideviceorientation

我有视图控制器1,2和3这样的链接,2和3带有模态segues:enter image description here

当用户处于横向模式一段时间(不一致的时间),展开到父视图,然后将手机旋转回肖像时,应用程序会因这些符号化的崩溃报告而崩溃:

3展开2:

  

由于未捕获的异常而终止应用   'NSInvalidArgumentException',原因:' - [NSConcreteMutableData   rotateOnDeviceRotation]:发送到实例的无法识别的选择器   0x19360600'

Last Exception Backtrace
0   CoreFoundation  0x297a1fef  __exceptionPreprocess + 127
1   libobjc.A.dylib 0x37a53c8b  objc_exception_throw + 39
2   CoreFoundation  0x297a7409  __methodDescriptionForSelector + 1
3   CoreFoundation  0x297a5327  ___forwarding___ + 715
4   CoreFoundation  0x296d4e78  __forwarding_prep_0___ + 24
5   Retrostock v2   0x28b293    0x28b28f
6   CoreFoundation  0x29759e09  __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 13
7   CoreFoundation  0x296b4515  _CFXNotificationPost + 1785
8   Foundation  0x2a415749  -[NSNotificationCenter postNotificationName:object:userInfo:] + 73
9   UIKit   0x2cdf78b7  -[UIDevice setOrientation:animated:] + 319
10  UIKit   0x2cdf766b  -[UIApplication handleEvent:withNewEvent:] + 1599
11  UIKit   0x2cdf6f69  -[UIApplication sendEvent:] + 73
12  Retrostock v2   0x1ef675    -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
13  Retrostock v2   0x1a850b    uvSendEvents (UVManager.m:162)
14  UIKit   0x2ce5cc81  _UIApplicationHandleEvent + 633
15  GraphicsServices    0x30f927d1  _PurpleEventCallback + 529
16  GraphicsServices    0x30f9241b  PurpleEventCallback + 35
17  CoreFoundation  0x297677cb  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
18  CoreFoundation  0x29767767  __CFRunLoopDoSource1 + 347
19  CoreFoundation  0x29765d69  __CFRunLoopRun + 1609
20  CoreFoundation  0x296b2201  CFRunLoopRunSpecific + 477
21  CoreFoundation  0x296b2013  CFRunLoopRunInMode + 107
22  GraphicsServices    0x30f91201  GSEventRunModal + 137
23  UIKit   0x2ce56a59  UIApplicationMain + 1441
24  Retrostock v2   0x169690    main () (AppDelegate.swift:14)
25  libdyld.dylib   0x37fdfaaf  start + 3

Crashed Thread 0 :
    0   CoreFoundation  0x297a231f  __handleUncaughtException + 631
    1   libobjc.A.dylib 0x37a53f13  objc_terminate() + 175
    2   libc++abi.dylib 0x37388de3  std::__terminate() + 79
    3   libc++abi.dylib 0x373888af  __cxa_rethrow + 103
    4   libobjc.A.dylib 0x37a53dd3  objc_exception_rethrow + 43
    5   CoreFoundation  0x296b229d  CFRunLoopRunSpecific + 633
    6   CoreFoundation  0x296b2013  CFRunLoopRunInMode + 107
    7   GraphicsServices    0x30f91201  GSEventRunModal + 137
    8   UIKit   0x2ce56a59  UIApplicationMain + 1441
    9   Retrostock v2   0x169690    main () (AppDelegate.swift:14)
    10  libdyld.dylib   0x37fdfaaf  start + 3

2展开1:

  

应用程序因信号SIGSEGV而崩溃

0   Retrostock v2   0x232293    0x23228f
1   CoreFoundation  0x29759e09  __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 13
2   CoreFoundation  0x296b4515  _CFXNotificationPost + 1785
3   Foundation  0x2a415749  -[NSNotificationCenter postNotificationName:object:userInfo:] + 73
4   UIKit   0x2cdf78b7  -[UIDevice setOrientation:animated:] + 319
5   UIKit   0x2cdf766b  -[UIApplication handleEvent:withNewEvent:] + 1599
6   UIKit   0x2cdf6f69  -[UIApplication sendEvent:] + 73
7   Retrostock v2   0x196675    -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
8   Retrostock v2   0x14f50b    uvSendEvents (UVManager.m:162)
9   UIKit   0x2ce5cc81  _UIApplicationHandleEvent + 633
10  GraphicsServices    0x30f927d1  _PurpleEventCallback + 529
11  GraphicsServices    0x30f9241b  PurpleEventCallback + 35
12  CoreFoundation  0x297677cb  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
13  CoreFoundation  0x29767767  __CFRunLoopDoSource1 + 347
14  CoreFoundation  0x29765d69  __CFRunLoopRun + 1609
15  CoreFoundation  0x296b2201  CFRunLoopRunSpecific + 477
16  CoreFoundation  0x296b2013  CFRunLoopRunInMode + 107
17  GraphicsServices    0x30f91201  GSEventRunModal + 137
18  UIKit   0x2ce56a59  UIApplicationMain + 1441
19  Retrostock v2   0x110690    main () (AppDelegate.swift:14)
20  libdyld.dylib   0x37fdfaaf  start + 3

我从Appsee收到这些报告,因为该应用程序现在处于测试阶段,我似乎无法在自己的设备上重新创建错误,所以在更新之前我依赖于知道错误是什么。

似乎应用程序“忘记”了它的视图,并且不知道要旋转到什么。如果您有任何想法或过去经历过类似的事情,我将非常感激。

更新1:

  

v2 / ShinobiCharts.framework / Headers / SChartBandSeries.h:42:57:属性   'readonly'属性'orientation'限制属性'readwrite'   继承自'SChartSeries'的财产

1 个答案:

答案 0 :(得分:0)

如果视图层次结构很简单,那么您最好只使用push segue导航然后展开。在没有看到代码的情况下,我们不得不假设对第二个控制器的引用丢失,因此旋转在尝试旋转时会崩溃(尽管我没有经历过这种情况)。

或者只是简单地回放一个或两个视图

self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
// Or to pop back 2
self.presentingViewController?.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)

<强>更新

你的问题是具体的Shonobicontrols。 https://www.shinobicontrols.com/forum/shinobicontrols/2014/3/app-terminated-on-rotation-in-[schartcanvas-viewabouttorotate]

我们最近修复了一个问题,该问题与被解除分配后发送到SChartCanvas的消息有关,与上述问题非常相似。 如果你看到这个问题,版本ShinobiCharts 2.7.3.hotfix2可能值得尝试。可从我们的门户网站下载。 我希望能解决你一直看到的问题,但如果问题仍然存在,请不要犹豫与我联系! :-) 谢谢 莱恩