【发布时间】:2010-12-27 09:16:35
【问题描述】:
我有一个 tableview,它的第一行包含一个 uiwebview。当用户单击按钮时,我想用新的对象更改此表的 webview 对象。我正在使用下面给出的代码,但它不能正常工作。尽管我重新创建了 webview,但较旧的对象在那里,而较新的对象已经结束。如何从单元格中删除旧的?
谢谢...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSLog(@"NİL.......");
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
} else {
NSLog(@"NOT NİL.......");
}
[cell addSubview:webView];
return cell;
}
【问题讨论】:
标签: iphone uitableview uiwebview