Я лучше в ios, может ли кто-нибудь сказать мне, что я управляю несколькими изменяемыми массивами? например: у меня есть 3 массива в том, что один массив для изображения, а два других массива содержат имя и описание, и я хочу отображать на ячейке UITableViewМножественный Mutable Array в IOS
Я попробовал это, но он разбился.
image = [[NSMutableArray alloc] initWithObjects:[UIImage imageNamed:@"[email protected]"], [UIImage imageNamed:@"[email protected]"], nil];
name = [[NSMutableArray alloc] initWithObjects:@"Dinner Bell Annouse 50% Discount on Punjabi Food!", nil];
time = [[NSMutableArray alloc] initWithObjects:@"13M", nil];
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return image.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
UIImageView *img = (UIImageView *) [cell.contentView viewWithTag:720];
UILabel *lbl1 = (UILabel *) [cell.contentView viewWithTag:721];
UILabel *lbl2 = (UILabel *) [cell.contentView viewWithTag:722];
img.image = [image objectAtIndex:indexPath.row];
// lbl1.text=[name objectAtIndex:indexPath.row];
// lbl2.text=[time objectAtIndex:indexPath.row];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
return cell;
}
какая ошибка? –
Не могли бы вы разместить здесь краш-лог? – iPeter