Ios 目标C-数组中对象的索引

Ios 目标C-数组中对象的索引,ios,objective-c,arrays,Ios,Objective C,Arrays,我有一个名为“teams”的数组和一个名为“teamType”的类的所有项。在我的方法中,我想检查“teamType”对象的索引,它的索引来自“teams”数组: teams[indexath.row]int index=[teams indexOfObject:objTeamType]@ChandanPrajapati要使其工作,该类至少需要实现一个方法,不是吗?然而,我认为他想要teamType*te=teams[indexPath.row]。是的,它成功了,非常感谢 -(void)tabl

我有一个名为“teams”的数组和一个名为“teamType”的类的所有项。在我的方法中,我想检查“teamType”对象的索引,它的索引来自“teams”数组:


teams[indexath.row]
int index=[teams indexOfObject:objTeamType]
@ChandanPrajapati要使其工作,该类至少需要实现一个方法,不是吗?然而,我认为他想要
teamType*te=teams[indexPath.row]。是的,它成功了,非常感谢
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

teamType *te = [[teamType alloc]init];
//here I want to check te's index depending on the indexpath 


[[NSUserDefaults standardUserDefaults]setObject:[te Name] forKey:@"buttonSelected"];
}
teamType *te = teams[indexPath.row];