我注意到,当我设置 MessageTableViewCell accessoryType =UITableViewCellAccessoryDetailDisclosureButton并在“箭头按钮”本身上进行选项卡时,在didSelectRowAtIndexPath: 上声明的弹出菜单不显示??!!!如果我在单元格的其他区域(“箭头按钮”本身除外)上进行选项卡,它工作正常,
但是,如果我改用UITableViewCellAccessoryDisclosureIndicator单元格附件类型,它可以正常工作,即使我在箭头本身上加了标签。
我想知道这是正常行为,错误还是我做错了什么。
我更喜欢UITableViewCellAccessoryDetailDisclosureButton,因为在我看来,当你想引起用户的注意时,它会更清楚。
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
static NSString* CellIdentifier = @"MessageCellIdentifier";
MessageTableViewCell* cell = (MessageTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = /*[*/[[MessageTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] /*autorelease]*/;
}
CastNearAppDelegate *appDelegate = (CastNearAppDelegate *)[[UIApplication sharedApplication] delegate];
Message* message = [appDelegate.dataModel messageWithID: indexPath.row];
if (!message.isSentByUser)
{
cell.accessoryType =/*UITableViewCellAccessoryDetailDisclosureButton; */UITableViewCellAccessoryDisclosureIndicator;
}else
{
cell.accessoryType = UITableViewCellAccessoryNone;
}
message.bubbleSize = [SpeechBubbleView sizeForText:message.text];
[cell setMessage:message];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIActionSheet *popupQueryOptions = [[UIActionSheet alloc]
initWithTitle:@"Options for Blocking and Spam Reporting"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"Block Sender"
otherButtonTitles:/*@"Block Sender",*/
@"Inappropriate Content",
/*@"Tell a Friend via Facebook",
@"Tell a Friend via Twitter",*/
nil];
popupQueryOptions.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQueryOptions showInView:[UIApplication sharedApplication].keyWindow];
}