次の場合、呼び出されるメソッドをUITableViewController
取得できないのはなぜですか?とメソッドUISearchBarDelegate
を省略しています。UITableViewDelegate
UITableViewDataSource
#import <UIKit/UIKit.h>
@interface OpportunitySearchViewController : UITableViewController <UISearchBarDelegate>
@end
#import "OpportunitySearchViewController.h"
@interface OpportunitySearchViewController ()
@end
@implementation OpportunitySearchViewController
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
NSLog(@"initWithCoder:");
};
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"self=%@ self.view=%@ ", self, [self view]);
}
- (void)viewDidUnload {
[super viewDidUnload];
NSLog(@"viewDidUnload");
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSLog(@"shouldAutorotateToInterfaceOrientation:");
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark - UISearchBarDelegate
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
NSLog(@"searchBar:textDidChange:");
}
@end
ストーリーボードシーンがOpportunitySearchViewContoller
クラスを使用するように構成されていることを確認しUISearchBar
、シーンのオンにファーストレスポンダーがデリゲートとして設定されていることを確認しました。それは間違っているかもしれませんが、ストーリーボードインターフェイスでファイルの所有者を見つけることができませんでした。
助けていただければ幸いです。