开发者

Removing all traces of a UIView

I've got another question. I've got this NavigationController, which has a delegate: MainViewController. In this navigation controller, there's a table view, which has the same delegate: MainViewController. Whenever I press a row in the table, a view pops up called: itemViewController.

Now, this all works really great. But when I press back, I want the itemViewController + it's view to be completely forgotten, it has to be destroyed 100%. Like it has never even existed.

which has a logical background: Whenever im done with the view, i press back. And when i want to see it again, i want it to be reloaded, i do not want an old reference to the view to be used, because the data it shows is changing all the time. So, in my situation right now, i have to relaunch the app to see the new data in the view.

Which, i find, really frustrating. So help me out, how can I make sure that view is delete开发者_如何学运维d, and reloaded completely when i click on it again from the table view?


Depends on how you have the reference to the itemViewController coded.

In general, [itemViewController release]; will remove the reference to the view controller.

The will mean that the next time you need the itemViewController, you will have to re-create it from scratch (e.g. [[itemViewController alloc] initWithNib: . . . . ] )

Another option you might consider would be setting up properties for the itemViewController and simply keeping the reference around and updating the properties before you push it into view.

Hard to give a definitive answer without seeing your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜