I have two tableviews, each tableview has only one cell to contain and now I want to add one UIWebView to this two tableviews' cell
- (void)loadView
{
interestView = [[UIWebView alloc] initWithFrame:_webViewFrame];
interestView.delegate = self;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}
//interestView is UIWebView
if (tableView == interestTableView) {
[cell.contentView addSubview:interestView];
}else if (tableView == headerTableView) {
[cell.contentView addSubview:interestView];
}
}
but this is not work, both table cell not shows the UIWebView. Any idea?