Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

okskpark

macrumors newbie
Original poster
Jul 26, 2008
9
0
Seoul, South Korea
I have a table view(view A). And when I click a row, it makes other view('view B) and push it to navigation controller.

The problem is I want to know which row, which is in view A, is clicked from view B
(...Now I'm confused about prepositions. :( sorry. English is not my mother tongue. I hope you understand.)


Code:
	aTableView = [[ATableViewController alloc] initWithStyle: UITableViewStyleGrouped];
	[[self navigationController] pushViewController:aTableView animated:YES];

I used an init function with 'initWithStyle'.
So, I think, I can not make my own initializer that can pass the indexpath or sth through arguments.

How can I know the row in view B?
 

lucasgladding

macrumors 6502
Feb 16, 2007
319
1
Waterloo, Ontario
There are a couple ways, but your best bet is simply to create an instance variable in the second view controller for the selected object. You can then set that before you push the second view controller. You probably don't need the indexPath, but rather the represented object.

Kind regards
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.