Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Data pass between two viewcontrollers

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 226
    Comment on it

    Hi All,

    If you need to pass data from one ViewContrlloer to other ViewController then first make properties in second ViewController in which you need that data For example:-


    In SecondViewController.h

    @interface SecondViewController : UIViewController
    
    @property (nonatomic,strong) NSString *model;
    
    @end
    

    Now, In first ViewController before pushing viewControlller ,just initialize that property with passing value:-

    In FirstViewController.m

    SecondViewController *verifyVC = [self.storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"];
    verifyVC.model = @"pass this data";
    [self.navigationController pushViewController:verifyVC animated:YES];
    

    Now , you can access this value in second view controller .

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: