// 名字
@property (nonatomic, retain)NSString *name;
// 手机号码
@property (nonatomic, retain)NSString *num;
// 照片名字
@property (nonatomic, retain)NSString *picture;
// 在通讯录中要声明一个学生对象的数组,注意以后所有的操作都要在学生对象中处理。
self.studentArray = [NSMutableArray array];
for (NSString *name in self.arr) {
// 创建学生对象
Student *student = [[Student alloc] init];
student.name = name;
student.picture = [NSString stringWithFormat:@"%@.jpg", name];
student.num = [NSString stringWithFormat:@"%@1", name];
[self.studentArray addObject:student];
[student release];
}
// 处理cell时所有的内容要在对象中显示
// 对象存放
Student *studet = [self.studentArray objectAtIndex:indexPath.row];
cell.textLabel.text = studet.name;
cell.MyView.image = [UIImage imageNamed:studet.picture];
cell.detailTextLabel.text = studet.num;