繁体   English   中英

解雇UIViewController后崩溃

[英]Crash after dismissing an UIViewController

有一小段时间以来,我的应用程序出现问题,一旦我解雇了特定的UIViewController,应用程序就会因为Tread 1:breakpoint 1.1 7.1而崩溃。

我将问题缩小为“容器视图”,该视图放置在被关闭的视图中。 我注意到主控制器和容器视图控制器先被释放,但看不到问题出在哪里。 我不确定何时引入此问题,因为我在特定的界面问题上工作了几天,却从未使用过“后退导航”选项。

我知道上面的描述非常模糊,但是任何有关调试可能原因的建议都将非常受欢迎,因为我在此阶段花费了数小时。

#0  0x00000001954440a8 in objc_exception_throw ()
#1  0x0000000184d05d88 in +[NSException raise:format:] ()
#2  0x0000000185b59f00 in NSKVODeallocate ()
#3  0x0000000184be5378 in CFRelease ()
#4  0x0000000184bf1938 in -[__NSArrayM dealloc] ()
#5  0x000000019545d724 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#6  0x0000000184be8f94 in _CFAutoreleasePoolPop ()
#7  0x0000000184cbb750 in __CFRunLoopRun ()
#8  0x0000000184be91f4 in CFRunLoopRunSpecific ()
#9  0x000000018dd775a4 in GSEventRunModal ()
#10 0x000000018951a784 in UIApplicationMain ()
#11 0x00000001000cdc04 in main at /Users/Luuk/Documents/Xcode development/idoms-portal/iDoms/main.m:14
#12 0x0000000195ab2a08 in start ()

编辑:我已将其范围缩小到将容器链接到视图控制器:

@interface DOPrototypeViewController : UIViewController <DOContentSizeCallback> {

    @protected
    DOMediaPlayerHelper* _mediaPlayerHelper;
    __weak NSString* _viewTitle;

    IBOutlet UIBarButtonItem *_previousPageBttn;
    IBOutlet UIBarButtonItem *_nextPageBttn;

    __weak IBOutlet UIView* _contentContainer;
    __weak IBOutlet UIScrollView* _scrollView;
}

@property (nonatomic, weak)  NSString* viewTitle;;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentViewHeightConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentViewWidthConstraint;

一旦IB中的容器被链接,就会发生问题。 如上所述,似乎在ContentContainer控制器之前先卸载了DOPrototypeViewController。 它必须与链接回到我感觉到的contentContainer的父视图有关。

我以前遇到过此类崩溃。 通常,将消息发送到以下对象:A:不再存在。 B:无法识别选择器。

开始查看堆栈跟踪。 看看崩溃前最后几个电话是什么。 这通常会为您指明正确的方向。

另外,如果遇到问题,请在此处发布崩溃日志和堆栈跟踪。

这是一个参考。 我添加了一个观察者[[self view] addObserver:self forKeyPath:@“ frame” options:0 context:nil]; 在两个控制器中,当我固定一个控制器时,从未看到第二个控制器,也没有将其移除。

暂无
暂无

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

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