UISearchBar と別の UITableView があります。ユーザーが SearchBar に何かを入力すると、API を呼び出し、TableView をリロードして新しい結果を表示します。TableView がリロードされるたびに、SearchBar はフォーカスを失います。どうすればこれを防ぐことができますか?
試してみ[_searchBar becomeFirstResponder];
ましたが、役に立ちませんでした。他のアイデアはありますか?
ご協力いただきありがとうございます。
(編集)データをリロードするために使用したコード:
[self.fetchedResultsController updateWithObjectList:_newList removeMissing:YES];
- (void)updateWithObjectList:(NSArray *)objectList removeMissing:(BOOL)removeMissing {
if (removeMissing) {
[self removeObjectList:[_objects allValues]];
}
[self addObjectList:objectList];
}