How can I move to another view controller when the user clicks on a row?

前端 未结 9 1323
梦如初夏
梦如初夏 2020-12-21 17:41

I am new to iPhone development, and I want to move to another page when the user clicks on a particular row. So, if they click on first row, I want the page to redirect to t

9条回答
  •  清歌不尽
    2020-12-21 18:22

    This was the one the things that I got problem when I first start. Here is my code that I use for this. In subviewcontroller I have my own constructor like

    -(id)initWithName:(NSString*)naMe
    {
         name=naMe;
         return self;
    }
    

    And in didSelectRowAtIndexPath Delegate method Of UITableView. I alloc it

     MyListView mylistview=[[MyListView alloc] initWithName:@"name"];
    
    [self.navigationController pushViewController:mylistview animated:YES];
    
    [mylistview  release];
    

提交回复
热议问题