views:

44

answers:

2

Hi,

I have 3 tableviews (each has ca. 100 rows). The last view is a simple UIView (detailview).

My idea was to create a navigation like a browser.

Structure:

Table1 > Table2 > Table3 > Detail

Navigation sequence: (sry can't publish images :-| )

 Table 1                ACTION
 +--------------------+
 |                    |
 +--------------------+
 | Table 1 .....      | <<SELECT
 +--------------------+

 Table 2
 +--------------------+
 | < back             |
 +--------------------+
 | Table 2 row 34     |
 | Table 2 row 35     | <<SELECT
 | Table 2 row 36     |
 | Table 2 row 37     |
 +--------------------+

 Table 3
 +--------------------+
 | < back             | <<GO BACK
 +--------------------+
 | Table 3 row 84     |
 | Table 3 row 85     | 
 | Table 3 row 86     |
 | Table 3 row 87     |
 +--------------------+

 Table 2
 +--------------------+
 | < back   > forward | >> GO FORWARD
 +--------------------+
 | Table 2 row 34     |
 | Table 2 row 35     | 
 | Table 2 row 36     |
 | Table 2 row 37     |
 +--------------------+

After clicking on forward at table 2 (last layout) i want to jump back to table 3 (third layout) with the old position (rows 84-87).

 ~~~~~~ After going forward ~~~~~

 Table 3
 +--------------------+
 | < back             |
 +--------------------+
 | Table 3 row 84     |
 | Table 3 row 85     | 
 | Table 3 row 86     |
 | Table 3 row 87     |
 +--------------------+

Is something like this possible? I know there is popViewController:animated:, but i cant go forward, to the "old" view.

A: 

your position resets because view is unloaded - retain your views.

GameBit
A: 

You can use pushViewController for forward and popViewController for backward...

Edited: Here goes the scenario:

you are in table1
Allocate table2 in `viewDidLoad` of table1View
Push to table2
Allocate table3 in `viewDidLoad` of table2View
Push to table3
WHEN YOU DO BACK ->call popViewController:animated
Now you are in table2
When YOU DO FORWARD -> call pusViewController:animated

Dats it... hope you got the point..

The main reason of allocating the object in viewDidLoad is that you can get the table as and in the position you have left it previously..

hAPPY cODING...

Suriya
If i pop table3 from the stack, i cant go forward from table2 back to the OLD table3 an his OLD position. Do you have a sample how can i push the OLD table3 back on the stack?
Raphael
you can push it to the table3 but keep in mind that you dont allocate the objevt of the 3rdtableview again before pushing it again
Suriya
I have edited the answer for better understanding.. check out the scenario....
Suriya