iOS Crashlogs中的.cxx_destruct

时间:2018-01-10 17:19:33

标签: ios objective-c xcode-storyboard

最近,我在Crashlytics中遇到了很多崩溃日志,我真的不知道为什么。

com.apple.main-thread
0  libsystem_kernel.dylib        0x1837dc60c __semwait_signal + 8
1  libsystem_c.dylib             0x1836f4f70 nanosleep + 212
2  libsystem_c.dylib             0x1836f4e90 usleep + 64
3  MyProject                     0x10336b554 -[MyViewController .cxx_destruct] + 2732324
4  MyProject                     0x1031d4424 -[MyViewController .cxx_destruct] + 1064948
5  MyProject                     0x1031d3ec4 -[MyViewController .cxx_destruct] + 1063572
6  MyProject                     0x1030e4c8c -[MyViewController .cxx_destruct] + 84060
在多个线程中多次调用

[MyViewController .cxx_destruct]

崩溃对我来说不可重复。如果应用程序在后台很长一段时间似乎会发生。我也很确定,崩溃日志中引用的视图没有显示,可能永远不会!它只是一个“关于应用程序”的视图,甚至很难找到用户。

#import "MyViewController.h"
#import "Localization.h"
#import "AppData.h"

@interface MyViewController ()

@property (weak, nonatomic) IBOutlet UILabel *myLabel;
... and many more

@end

@implementation MyViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    //set logo, text and so on
    ...
}

#pragma mark - Action handler

- (IBAction)handleCloseActionPerformed:(id)sender {
    dispatch_async(dispatch_get_main_queue(), ^{
        [self dismissViewControllerAnimated:YES completion:nil];
    });
}

@end

用户可以通过单击执行以下代码或单击条形按钮项来打开视图。

NSString * storyboardName = @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"AboutViewController"];;
[self presentViewController:vc animated:YES completion:nil];

0 个答案:

没有答案