Passing value from ViewController to NSObject in Xcode : I need to pass value from a ViewController to NSObject as soon as the view loaded using Xcode with Objective c.

I am using the code below but the value is null.

    -(void)viewDidAppear:(BOOL)animated
    {
         MyHomeModelNSObject *nsOb;
         nsOb.myString = self.userName.text;
    }

The above code is working between Views when using segue, but it does not work with when passing the value to NSObject.

Thanks