user3653710
user3653710

Reputation: 25

IOS - Write to UITextField from another class in the IOS Application

I have method in ViewController:

(void) writeInViewController:(NSString *)var {
         NSLog(@"Var: %@", var);

}

I send value to this method(writeInViewController) from another class it's receive the value and print it in the Debug Area but I can't write to the User Interface (textfield.text = var) I need to add text to the UITextField from this method

Thanks

Upvotes: 0

Views: 55

Answers (1)

Ashwinkumar Mangrulkar
Ashwinkumar Mangrulkar

Reputation: 2965

If i am not wrong your value getting null when you are assign to UITextField, do one thing create one instance variable or property then assign that value to variable then assign to UITextField it will work.

Upvotes: 1

Related Questions