Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法检查视图是否即将被删除?我已将 UITableViewCell 子类化,并想通知单元格是否即将被表格丢弃(我的表格在每个部分中都有可变大小的单元格,因此有时它确实会丢弃单元格)。
您可以覆盖以下方法:
- (void)willRemoveSubview:(UIView *)subview
http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instm/UIView/willRemoveSubview: