Начните с создания сохраненного свойства, которое будет источником данных вашего UITableView.
в .h файле
@property (strong, nonatomic) NSArray *dataSource; //use retain instead of strong if not using ARC
Затем извлеките массив из словаря в ваш источник данных
self.dataSource = [dict objectForKey:@"New item"]; //only if it's guaranteed that the dictionary contains that array
Затем реализуйте протокол источника данных табличного представления двумя способами:
- (NSInteger)tableViewNumberOfRowsInSection:(UITableView *)tableView {
return dataSource.count; // create cells by count of array
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath)indexPath {
static NSString *reuseIdentifier = @"fruit";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; // add autorelease if not using ARC
//add your UIButton here, give it tag
UIButton *button = ...;//alloc the button and give it proper frame and add it as cell's subview
[cell.contentView addSubview:button];
button.tag = 5;
}
//extract the button and give it title
UIButton *button = (UIButton *)[cell viewWithTag:5];
button.title = [dataSource objectAtIndex:indexPath.row];
return cell;
}
Таким образом, вы должны узнать о делегировании и о том, что это за протоколы.Прочитайте Руководство по программированию UITableView для получения дополнительной информации.