iOS公开按钮不会推送包含信息的视图

时间:2013-08-21 11:21:01

标签: ios button view disclosure

在按下公开按钮时,我想推送另一个视图,其中包含按下公开按钮的单元格的详细信息。我有下面的代码,但不知道为什么它不起作用。在单击公开按钮时,程序会进入tableView:accessoryButtonTappedForRowWithIndexPath功能,但不会显示视图。

-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
    self.detailController.title = @"Single Contact";
    NSMutableArray *array = [[NSMutableArray alloc] init];
    if (indexPath.section == 0) {
        array = self.friends;
    }
    else if (indexPath.section == 1) {
        array = self.members;
    }else{
        array = self.invite;
    }
    NSDictionary *data = [array objectAtIndex:indexPath.row];
    NSString *name = [data valueForKey:@"firstName"];
    self.detailController.message = name;
    [self alertMeWithString:@"THIS STRING"];
    [self.navigationController pushViewController:self.detailController animated:YES];  

}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if(self){
        self.detailController = [[DSZContactDetailViewController alloc] init];
    }
    return self;
}

0 个答案:

没有答案