簡體   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