2015-03-31 26 views
0

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7c37edd0 of class PlayingTimer was deallocated while key value observers were still registered with it'類PlayingTimer的實例0x7c37edd0被釋放,而鍵值觀察者仍然註冊它。目前的觀察

+0

謝謝您的信息!而且,問題是什麼? – 2015-03-31 06:51:33

+0

我已經使用audio recorder.its記錄音頻輸入。當iam按回按鈕時拋出此錯誤。 – 2015-03-31 06:55:02

+0

我相信你正在爲'PlayingTimer'類添加一些通知觀察者,但不會在'dealloc'方法中刪除它。在'dealloc'中移除觀察者。 – Gandalf 2015-03-31 07:00:12

回答

0

你實際上沒有問一個問題,但似乎你發佈了答案。

閱讀例外說什麼。它確切地說出了什麼問題。你有觀察員的對象。在某個時候,該對象的dealloc方法被調用。在調用dealloc之後,它仍然有觀察者。如果在調用dealloc後你有觀察者,你的應用程序將崩潰。所以你必須確保在調用dealloc之後沒有觀察者。

相關問題