Я пытаюсь загрузить три разных изображения из массива в соответствующие ячейки в UITable. Пока у меня есть следующий код, который создает хорошие сбои при запуске t. Я могу помочь мне, я был бы очень благодарен.
- (void)viewDidLoad {
NSArray *array = [[NSArray alloc] initWithObjects:@"Icon Nightclub", @"Smyhts Bar",
@"Synotts",nil];
self.listData = array;
NSArray *picArray = [[NSArray alloc] initWithObjects:@"ArrowLeftDefault.png", @"ArrowRightDefault.png",
@"events.png",nil];
self.picData = picArray;
[array release];
[picArray release];
[super viewDidLoad];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [listData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:SimpleTableIdentifier] autorelease];
}
NSUInteger row = [indexPath row];
cell.textColor = [UIColor grayColor];
cell.textLabel.text = [listData objectAtIndex:row];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.imageView.image = [picData objectAtIndex:indexPath.row];
return cell;
}