我想要做的是格式化我的表格视图单元格,如下:
[IMG] CELL_NAME [IMG]STRING [IMG]STRING
我已经想出了如何为单元格添加标题图像和名称,但是我无法弄清楚如何使用附加的字符串添加剩余的两个图像。 (见上文)
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *path = [[NSBundle mainBundle] pathForResource:@"Upgrades" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
upgrades = [dict objectForKey:@"UpgradeStrings"];
thumbnails = [dict objectForKey:@"UpgradeImages"];
_regularBubbleLabel.text = [NSString stringWithFormat:@"%li", [RWGameData sharedGameData].regularBubbleCount];
_premiumBubbleLabel.text = [NSString stringWithFormat:@"%li", [RWGameData sharedGameData].premiumBubbleCount];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Handles appearance of cells in table.
static NSString *TableIdentifier = @"TableCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableIdentifier];
}
cell.textLabel.text = [upgrades objectAtIndex:indexPath.row];
cell.imageView.image = [UIImage imageNamed:[thumbnails objectAtIndex:indexPath.row]];
return cell;
}