Possible Duplicate:
Xcode: Storyboard Tabbed Application Passing Data Back and Forth
Basically I have 2 view controllers
1st view controller : contains table view
2nd view controller: contains image view
I want to load the image on 2nd view controller based upon the value selected from table view (from 1st view contrller)
I know I can capture the value of selected cell using following code
NSString *CellVal = [[NSString alloc]init];
CellVal = [exercises objectAtIndex:indexPath.row];
but how do I refer the value of “CellVal” in 2nd View conroller ?
Create a NSString property in your second controller. Then, at some point, use something like
secondController.stringProperty = cellVal;.The place where you put the code you posted and that assignment depends on whether you are using xib files or a storyboard. In one case, you would do it where you initialize the second controller from a nib and otherwise you would do it in prepareForSegue: (using the destination controller from the seque).