简体   繁体   中英

how to pass tableview from one view controller hide to another view controller unhide using button action

I am new to IOS i created two view controller.First view controller contain tableview as table1 and Second view controller contains button. I want to pass table1 to second view controller and unhide table1 in button action.

pop up for second view controller 第二个ViewController的样本

first view controller after button action in second view controller

我希望可以使用tableviewcell在第一个控制器中添加此类型的日期

For instance, consider I had two view controllers. The first contains one button and the second needs to know information on the first view . You could wire the buttons up to an IBAction in your code which uses performSegueWithIdentifier: method, like this...

// When any of my buttons are pressed, push the next view
- (IBAction)buttonPressed:(id)sender
{
    [self performSegueWithIdentifier:@"MySegue" sender:sender];
}

// This will get called too before the view appears
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Make sure your segue name in storyboard is the same as this line
    if ([[segue identifier] isEqualToString:@"YOUR_SEGUE_NAME_HERE"])
    {
        // Get reference to the destination view controller
        YourViewController *vc = [segue destinationViewController];

        // Pass any objects to the view controller here, like...
        [vc setMyObjectHere:object];
    }
}

For more information you can see this: http://www.appcoda.com/storyboards-ios-tutorial-pass-data-between-view-controller-with-segue/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM