Изменение изображения для кнопки раскрытия сведений (Xcode 4.2)

Я использовал следующую предложенную процедуру для изменения изображения кнопки раскрытия подробностей в ячейке представления таблицы (в tableView cellForRowAtIndexPath)

if (cell == nil) {

    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];

    UIButton *myAccessoryButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
    [myAccessoryButton setBackgroundColor:[UIColor clearColor]];
    [myAccessoryButton setImage:[UIImage imageNamed:@"ball"] forState:UIControlStateNormal];
    [cell setAccessoryView:myAccessoryButton];
    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}

Однако событие tableView accessoryButtonTappedForRowWithIndexPath больше не вызывается при нажатии кнопки.

Есть ли у кого-нибудь идеи, почему?

5
задан rikitikitik 16 January 2014 в 02:08
поделиться