Какой у тебя вопрос, спикидуде.
Мне кажется, что вы хотите добавить кнопку в ячейку tableView, изображение которой будет либо звездой, либо точкой.И это вы можете легко получить из базы данных.Просто добавьте одно if
условие в ваш метод cellForRowAtIndexPath
, и вы получите то, что хотите /
РЕДАКТИРОВАТЬ:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if(value==0)
{
//create your button with proper frame
yourButton.tag = value;
[yourButton setImage:[UIImage iamgeNamed:@"dot.png"];
}
else if(value==1)
{
//create your button with proper frame
yourButton.tag = value;
[yourButton setImage:[UIImage iamgeNamed:@"star.png"];
}
else
{
}
return cell;
}
Или, если вы хотите получить значение из базы данных, укажитетот.