IPhone SDK - Leaking Memory with performSelectorInBackground

前端 未结 2 1203
暖寄归人
暖寄归人 2020-12-12 07:15

Maybe someone can help me with this strange thing:

If a user clicks on a button, a new UITableView is pushed to the navigation controller. This new view is doing som

2条回答
  •  忘掉有多难
    2020-12-12 07:21

    Btw, you're calling pushViewController: from a background thread. This is bad.

    You should only do things to the UI - like pushing view controllers and changing UI items - from the main thread. If you don't, things break.

    See the Cocoa Fundamentals Guide section titled "Are the Cocoa Frameworks Thread Safe?": it says "All UIKit objects should be used on the main thread only."

提交回复
热议问题