简体   繁体   English

更新到IOS7后应用程序崩溃

[英]Application crash after updated to IOS7

I have updated my app to IOS7 and now I have very strange issue. 我已将我的应用程序更新为IOS7 ,现在我的问题非常奇怪。
When I start app it start to do what it suppose to do and after 3-5 minutes app stops to work. 当我启动应用程序时,它开始执行它想要做的事情,并在3-5分钟后应用程序停止工作。
But not completely. 但不完全。 It stops to send notifications, track location etc. 它停止发送通知,跟踪位置等。
And if I try to make some action I get this in console: 如果我尝试做一些动作,我会在控制台中得到这个:

*** First throw call stack:
(
    0   CoreFoundation                      0x0305f5e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x0276e8b6 objc_exception_throw + 44
    2   CoreFoundation                      0x0305f3bb +[NSException raise:format:] + 139
    3   UIKit                               0x0157465c -[UINib instantiateWithOwner:options:] + 951
    4   UIKit                               0x013e6c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
    5   UIKit                               0x013e743d -[UIViewController loadView] + 302
    6   UIKit                               0x013e773e -[UIViewController loadViewIfRequired] + 78
    7   UIKit                               0x0140d1a5 -[UINavigationController _layoutViewController:] + 39
    8   UIKit                               0x0140d6bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
    9   UIKit                               0x0140d7b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
    10  UIKit                               0x0140e72c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
    11  UIKit                               0x0140f349 -[UINavigationController __viewWillLayoutSubviews] + 57
    12  UIKit                               0x0154839d -[UILayoutContainerView layoutSubviews] + 213
    13  UIKit                               0x0cf0656f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50
    14  UIKit                               0x0133edd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    15  libobjc.A.dylib                     0x0278081f -[NSObject performSelector:withObject:] + 70
    16  QuartzCore                          0x00ef972a -[CALayer layoutSublayers] + 148
    17  QuartzCore                          0x00eed514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    18  QuartzCore                          0x00eed380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    19  QuartzCore                          0x00e55156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    20  QuartzCore                          0x00e564e1 _ZN2CA11Transaction6commitEv + 393
    21  QuartzCore                          0x00f12870 +[CATransaction flush] + 52
    22  UIKit                               0x012f0979 _afterCACommitHandler + 131
    23  CoreFoundation                      0x0302753e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    24  CoreFoundation                      0x0302748f __CFRunLoopDoObservers + 399
    25  CoreFoundation                      0x030053b4 __CFRunLoopRun + 1076
    26  CoreFoundation                      0x03004b33 CFRunLoopRunSpecific + 467
    27  CoreFoundation                      0x0300494b CFRunLoopRunInMode + 123
    28  GraphicsServices                    0x03ce89d7 GSEventRunModal + 192
    29  GraphicsServices                    0x03ce87fe GSEventRun + 104
    30  UIKit                               0x012d494b UIApplicationMain + 1225
    31  MyApp                           0x0000759d main + 141
    32  libdyld.dylib                       0x02c53725 start + 0
    33  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException


Any idea what is this? 知道这是什么意思吗?
App works fine in IOS6. 应用程序在IOS6中运行良好。

Create an exception breakpoint in Xcode that stops on all exceptions. 在Xcode中创建一个在所有异常上停止的异常断点。 Then the debugger will stop when that exception is raised. 然后调试器将在引发该异常时停止。 It looks like it is in 它看起来像是在

[UINib instantiateWithOwner:options:]

But I can't tell if you are calling that or the system. 但我无法分辨你是在呼叫那个还是系统。

See here for a related issue: Terminating app due to uncaught exception 'NSUnknownKeyException' 请参阅此处了解相关问题: 由于未捕获的异常'NSUnknownKeyException'而终止应用

I must test this on real phone just to be sure. 我必须在真正的手机上进行测试才能确定。
I have a piece of code that refreshes some labels in the view every X seconds. 我有一段代码每隔X秒刷新视图中的一些标签。
It works fine until IOS7. 它工作正常,直到IOS7。 On IOS7 app crashes after 3 minutes and I get the error from the question. 在IOS7应用程序崩溃3分钟后,我从问题中得到错误。
Every time I refresh labels in the view I was opened a new connection to sqlite to get data. 每次我在视图中刷新标签时,我都会打开一个新的sqlite连接来获取数据。
In IOS7 I get error so I made one instance of data access class and init it only in viewDidLoad() and now it works fine. 在IOS7中我收到错误所以我创建了一个数据访问类实例并仅在viewDidLoad()中启动它,现在它工作正常。
If after test I confirm that I am right I will definitely make singleton pattern of my data access class. 如果经过测试我确认我是对的,我肯定会制作我的数据访问类的单例模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM