![this is the code for.m class of first viewcontroller[][1]](../../images/3845459128.webp) I had tried accessing value of IVAR of one viewcontroller to another viewcontroller by making use of property , but i am getting null value.
I had tried accessing value of IVAR of one viewcontroller to another viewcontroller by making use of property , but i am getting null value.
please let me know how to get value displayd in my secondviewcontroller.

![this is the code for.m class of first viewcontroller[][1]](../../images/3845459128.webp) I had tried accessing value of IVAR of one viewcontroller to another viewcontroller by making use of property , but i am getting null value.
I had tried accessing value of IVAR of one viewcontroller to another viewcontroller by making use of property , but i am getting null value.
please let me know how to get value displayd in my secondviewcontroller.

 
    
     
    
    You are doing the right way to get value of property. But you need to make sure myString has been assigned a value in init method of ViewController.
Try in ViewController.m:
- (instancetype)init {
    self = [super init];
    if (self) {
        self.myString = @"My String";
    }
    return self;
}
Beside of it, make sure that myMetod of SecondViewController is called. If myMetod is called, "Print value My String" will be printed.
