I have researched this question. Looks like this is a common question but nothing I have tried has worked. I am very new to iPhone app development and Objective C. All I want to do at this point is type in a string in a search bar field and return the value in NSLog() when the Search button on the keypad is tapped.
My header file looks like this:
@interface ListingMapViewController : UIViewController <UISearchBarDelegate>
@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;
@end
I have this in my class file:
#import "ListingMapViewController.h"
@interface ListingMapViewController ()
@end
@implementation ListingMapViewController
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
searchBar.delegate =self;
[self handleSearch:searchBar];
NSLog(@"User searched for %@", searchBar.text);
}
@end
When I click the Search button nothing outputs. What am I missing? Thanks.