PDA

View Full Version : tabBarController, clicking an item a second time




estupefactika
Mar 3, 2009, 04:21 AM
Hi, I have a tabBarController. Each item has a ViewController. It works fine, the problem is when I click an item a second time. In the first time it load methods, I update any thing, etc... but a second time it doesnt do nothing, I would like to update some data but it doesnt load methods again

Is there any way to solve it? Thanks



iphonedevelop18
Mar 3, 2009, 02:03 PM
I believe this could be fixed by making all the tab bars under 1 view controller

dejo
Mar 3, 2009, 02:05 PM
It works fine, the problem is when I click an item a second time.
Let me get this straight: you are clicking a tab bar item that is already selected, correct?

estupefactika
Mar 3, 2009, 04:08 PM
Let me get this straight: you are clicking a tab bar item that is already selected, correct?

No, it has already been selected previously.
All my tab bar item use the same ViewController, depending what is clicked, it display one or other things.

Example:
- I click in tab bar item 1, it display me a table. Correct.
- I click in tab bar item 2, it does the same, correct.
- Now, in tab bar item 2 I update all data clicking a UIButton, it display me the table updated, correct. But If I come back to tab bar item 1, it contains the old table not updated, I need reload it. I think is because the view has already been loaded previously. I would need to reload it again. It is possible?

dejo
Mar 3, 2009, 04:14 PM
It is possible?
It is. Look into the setNeedsDisplay instance method of UIView or the reloadData instance method of UITableView.