Я перетащил UISearchBar на свою XIB, подключил его к владельцу моего файла для делегата и searchBar в качестве выхода.Я получаю сбой, когда я перехожу на вид с панели поиска.Я не знаю, что я делаю не так, мне нужно реализовать методы делегата панели поиска, прежде чем он перестанет падать?
#import <UIKit/UIKit.h>
@interface ThirdViewController : UIViewController {
@private UISearchBar *searchBar_;
}
@property (nonatomic, retain) IBOutlet UISearchBar *searchBar;
@end
#import "ThirdViewController.h"
@implementation ThirdViewController
@synthesize
searchBar = searchBar_;
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[searchBar_ release], searchBar_ = nil;
[super dealloc];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.searchBar resignFirstResponder];
}
@end