I have a ViewController with a UITextField. The user enters a string of characters into the textField, clicks a done button and then this value should be passed to a method in the entity class. I know I need to pass this value as a parameter but I’m getting stuck.
I’ve tried to pass this value by adding a parameter to the end of the clickDone IBAction for the done button with no luck. Thank you for even the smallest bit of help or point into the right direction.
- (IBAction)doneClicked:(NSString*) name {
...
}
I’ve tried creating an ivar for ViewController in my entity class h file but Xcode asks “Unknown type name ‘ViewController’; did you mean UIViewController?
@interface EntityClass : NSManagedObject{
ViewController* refVC;
UITextField* textBox;
}
and then use
self.name = self.refVC.textBox.text;
in my method in entity class m file to return the NSString self.name
I figured it out. This is my final code. It works. Help is no longer needed.
Thanks!