Ios 在tableview中同时使用动态和静态分区
在tableview中管理单元格时遇到问题 我有一个包含两个部分的表视图: 第一个,我有3个自定义单元格,带有静态单元格 第二个,我有一个动态类型 要使用动态的,没有问题,但是静态的,我不知道如何重用它们Ios 在tableview中同时使用动态和静态分区,ios,objective-c,uitableview,Ios,Objective C,Uitableview,在tableview中管理单元格时遇到问题 我有一个包含两个部分的表视图: 第一个,我有3个自定义单元格,带有静态单元格 第二个,我有一个动态类型 要使用动态的,没有问题,但是静态的,我不知道如何重用它们 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(indexpath.section = 0){ //h
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexpath.section = 0){
//here is the question, how to return the stactis that had already been defined
}else{
return cell //here is okay, i can return the dynamic
}
3个静态单元格中的每一个,我需要放置一个标识符?动态的一个我做了不同的,但工作正常
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexpath.section = 0){
//here is the question, how to return the stactis that had already been defined
static NSString *CellIdentifier = @"StaticCell";
StaticCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
return cell;
}else{
static NSString *CellIdentifier = @"DynamicCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil){
cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
}