我需要通過類的對象數組 我已經類稱爲學生,它有一些屬性(名稱,代碼,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;
}
我發現一些問題與刪除,因爲我通過指數的想法刪除如何傳遞對象數組中的表視圖