我需要通过类的对象数组 我已经类称为学生,它有一些属性(名称,代码,ACCOUNT_TYPE ....);目标C - 传递对象的数组表视图
我调用数据库的方法来获取所有招生对象
Student_array = [data_base_helper selectAllStudents];
我需要显示在表视图学生名单,我制作的其它阵列叫名字
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [Student_array count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString * cell_identifer = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cell_identifer forIndexPath:indexPath];
// Configure the cell...
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cell_identifer];
}
for(Student * st in student_array){
[self.names addObject:st.student_name];
}
cell.textLabel.text = [names objectAtIndex:indexPath.row ];
return cell;
}
我发现一些问题与删除,因为我通过指数的想法删除如何传递对象数组中的表视图