Fixed: Several views of _CPTableDrawView created when encoding and decoding a CPTableView

Previously, when encoding and decoding a CPTableView, the tableView had several _CPTableDrawView (in the subviews).
Now when encoding, we make sure to remove _CPTableDrawView from its superview.
This commit is contained in:
Alexandre Wilhelm committed 2014-09-30 15:28:26 -07:00
1 parent 321a5533df
commit b617d60b60
1 file changed
+5
+5
View File
@@ -6025,6 +6025,11 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
{
[super encodeWithCoder:aCoder];
// We do this in order to avoid encoding the _tableDrawView, which
// should just automatically be created programmatically as needed.
if (_tableDrawView)
[_tableDrawView removeFromSuperview];
[aCoder encodeObject:_dataSource forKey:CPTableViewDataSourceKey];
[aCoder encodeObject:_delegate forKey:CPTableViewDelegateKey];