-2
我想弄清楚,利弊在两个以下。两者都很好。UITableViewCell自定义
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
UITableViewCell *tableViewCell = nil;
MyChildUITableViewCell *childTableViewCell =
(MyChildUITableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"MyChildUITableViewCell"];
tableViewCell = childTableViewCell;
return tableViewCell;
}
OR
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MyChildUITableViewCell *childTableViewCell = nil;
childTableViewCell = (MyChildUITableViewCell*)
[tableView dequeueReusableCellWithIdentifier:@"MyChildUITableViewCell"];
return childTableViewCell;
}
问题标题与代码有什么关系? – Shubhank