嘿傢伙,我越來越瘋狂。UIAnimator消息發送到釋放的實例
*** -[UIAnimator removeAnimationsForTarget:]: message sent to deallocated instance 0x5ba13d0
它發生在不同的時刻,當我滾動我的tableview,當我轉我的過濾器(一個UISegmentedControl)。
幫助我,我與這個傢伙瘋狂:) 我該如何解決?
嘿傢伙,我越來越瘋狂。UIAnimator消息發送到釋放的實例
*** -[UIAnimator removeAnimationsForTarget:]: message sent to deallocated instance 0x5ba13d0
它發生在不同的時刻,當我滾動我的tableview,當我轉我的過濾器(一個UISegmentedControl)。
幫助我,我與這個傢伙瘋狂:) 我該如何解決?
我剛剛解決了同樣的問題。 我認爲它與UIAnimation有關,但它與UITableViewCell相關,取而代之。 我發現一個很好的起點看這篇文章。
http://marius.me.uk/blog/2011/mar/fixing-uianimator-removeanimationsfortarget-crash/
祝你好運,讓我知道!
不客氣 – pasine 2011-03-21 00:15:05
我有相同的症狀(由[UIAnimator removeAnimationsForTarget:]
消息發送到釋放的UITableViewCell引起的崩潰,但事實證明,這是由於上述解決方案中引用的原因不同而導致的結果,原因是我的用戶界面是由一個非UI線程更新。具體來說,我是從後臺線程調用popViewController:animated:
。當我通過一個回調的問題就走了移動這個調用到UI線程。
兩個@ ER0和@notme的回答是對的
當我m在storyBoard中有兩個不同的Cell UI,並試圖在tableView:cellForRowAtIndexPath
中使用它們,它給了我一個完全不同的按鈕動作的這個錯誤。該方法與UITableViewCell無關(AFAIK)。
首先,我使用了@ er0的方法:在我得到崩潰的方法中,在主線程中執行它。
performSelectorOnMainThread:withObject:waitUntilDone
它解決了崩潰問題。
然後我意識到我的tableView:cellForRowAtIndexPath
代碼需要重構。在某些特殊情況下,我使用dequeueReusableCellWithIdentifier
兩次來獲得單個indexPath
。重構代碼並將if-else放在一個dequeueReusableCellWithIdentifier
未針對單個indexPath調用兩次的方式中。它解決了我的崩潰問題,我不再需要performSelectorOnMainThread"
。
我結束了使用註釋的解決方案。
我們需要更多的代碼。另外,請嘗試對項目進行構建和分析,看看是否指向任何內容。 – 2011-02-24 04:43:30
它看起來像執行任何操作時,removeAnimationsForTarget方法調用一個釋放的對象。你可以找出它發生的位置。 – Ishu 2011-02-24 04:47:57
我會從[搜索以前的問題](http://stackoverflow.com/search?q=sent+to+deallocated+instance)開始,這是一個常見問題,解決方案也是一樣的。 – zoul 2011-02-24 07:18:50