Sunday, 29 September 2013

Calling addSubview after removeFromSuperview

Calling addSubview after removeFromSuperview

I am working on a simple UI, but am running into trouble with addSubview
calls made after a removeFromSuperview.
In my viewController I have an IBOutlet UITableView
@property (strong, nonatomic) IBOutlet UITableView *tableView;
Depending on the state of the data, I remove the tableview from my
viewControllers view.
[self.tableView removeFromSuperview];
So far so good, the view is removed. When using the debugger, I can still
see that my viewController has a valid handle to the tableview. The
problem starts on the next line when I call addSubview.
[self.view addSubview:self.tableView];
It seems to do nothing and I can't see any change in the UI. I have tried
to set the frame on the tableView and still no results.
Have any of you seen this behavior?
Joe

No comments:

Post a Comment