I want to pass whatever string a user inputs into a UITextField' over to the destination view controller, but when I NSLog the value in the destination, it shows up as null. I'm also getting a warning stating:
incompatible pointer types assigning to UITextField from NSString`. How can I properly make the assignment and send it over?
Originating view controller
SearchViewController.m:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
controller.itemSearch = self.itemSearch.text;
}
SearchViewController.h:
@property (weak, nonatomic) IBOutlet UITextField *itemSearch;
Destination view controller
UserCategoryChooserViewController.h:
#import <UIKit/UIKit.h>
#import "SearchViewController.h"
@interface UserCategoryChooserViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *itemSearch;
UserCategoryChooserViewController.m:
NSLog(@"The text is:'%@'", self.itemSearch.text); // results in (null)