If I understand what you are asking you have a TableView (TableView1) in which each cell loads up a new view (MyView1) with content dependent on the indexPath of the cell. When you receive the isSelected method, can't you just pass the indexPath to the constructor of the new view you are creating? For example
–(void) selectRowAtIndexPath:(NSIndexPath*) indexPath animated:(BOOL) animated (UITableViewScrollPosition)scrollPosition {
UIView* view = [[[MyView1 alloc] initWithIndexPath:indexPath] autorelease];
//push or load the view
}
You will then need to create your own class MyView1 which inherits from UIView, and add the constructor to accept the extra parameter and store it.
If your not creating the UIView or it already exists, then I'm not completely sure what you are asking, so I'll just have a guess. If you are asking how to share information between to UIView's, and your problem is that each UIView in question does not know about the other.
A simple way to share information globally about your app would be to create a static class following the Singleton design pattern which each UIView can access, and modify.
//header
@interface MySingleton {
NSIndexPath* myIndexPath;
}
@property (nonatomic, retain) myIndexPath;
+(id) globalSingleton;
@end
In the source (.m) file
//source
static MySingleton* singleton = nil;
@implementation MySingleton
@synthesize myIndexPath;
+(id) globalSingleton {
if (singleton == nil) {
singleton = [MySingleton new];
}
return singleton;
}
@end
Its possible I've misunderstood your question and this solution might not be the best way to solve your problem. Please clarify the design of your interface and we can help more. Good Luck.
--EDIT:
From what you say, the first solution should be applicable.
When you get the 'isSelected' message to your TableView, you should be creating the WebView object. Simply overwrite the init function to accept whatever parameters you need, in this case the NSIndexPath of the selected table. I'm sure there are some examples at developer.apple.com search for the example projects using customised UITableView's and Navigation View Controllers.