在Swift
ARC 中,deinit
当 anyUIViewController
从 memory 中删除时调用,但如果 any 从 memory 中删除,则不会被调用UIView
。
例如
如果UIViewController
类deinit
工作得很好
class MusicPlayerUIViewController: UIViewController,UITableViewDelegate,UITableViewDataSource
{
deinit
{
APP_DELEGATE.RemovePlayerContents()
}
}
但万一UIView
上课deinit
不工作
class MusicPlayerView: UIView,UITableViewDelegate,UITableViewDataSource
{
deinit
{
APP_DELEGATE.RemovePlayerContents()
}
}
任何的想法 。