iOS disclosure button doesnt push a view with information

98 views Asked by At

On pressing a disclosure button i want to push another view containing the details of the cell from which the disclosure button was pushed. I have the code below but dont know why it doesnt work. On clicking the disclosure button the programme does go into the tableView:accessoryButtonTappedForRowWithIndexPath function but doesnt bring up the view.

-(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

There are 0 answers