forked from organicmaps/organicmaps
Merge pull request #6161 from igrechuhin/cherry
[cherry] [FABRIC-7708] [ios] Fixed search ads indexer crash.
This commit is contained in:
commit
42a1ec9918
3 changed files with 10 additions and 5 deletions
|
@ -106,12 +106,10 @@ using TObservers = NSHashTable<__kindof TObserver>;
|
|||
f.SearchInViewport(m_viewportParams);
|
||||
}
|
||||
}
|
||||
[self updateItemsIndexWithBannerReload:YES];
|
||||
[self onSearchCompleted];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self updateItemsIndexWithBannerReload:NO];
|
||||
[self onSearchResultsUpdated];
|
||||
}
|
||||
};
|
||||
|
@ -259,7 +257,6 @@ using TObservers = NSHashTable<__kindof TObserver>;
|
|||
auto manager = [MWMSearch manager];
|
||||
manager->m_everywhereResults.Clear();
|
||||
manager.suggestionsCount = 0;
|
||||
[manager updateItemsIndexWithBannerReload:YES];
|
||||
[self reset];
|
||||
}
|
||||
|
||||
|
@ -357,6 +354,7 @@ using TObservers = NSHashTable<__kindof TObserver>;
|
|||
// if (allCompleted && allEmpty)
|
||||
// [[MWMAlertViewController activeAlertController] presentSearchNoResultsAlert];
|
||||
|
||||
[self updateItemsIndexWithBannerReload:YES];
|
||||
for (TObserver observer in self.observers)
|
||||
{
|
||||
if ([observer respondsToSelector:@selector(onSearchCompleted)])
|
||||
|
@ -366,6 +364,7 @@ using TObservers = NSHashTable<__kindof TObserver>;
|
|||
|
||||
- (void)onSearchResultsUpdated
|
||||
{
|
||||
[self updateItemsIndexWithBannerReload:NO];
|
||||
for (TObserver observer in self.observers)
|
||||
{
|
||||
if ([observer respondsToSelector:@selector(onSearchResultsUpdated)])
|
||||
|
|
|
@ -390,7 +390,6 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerActionBarState) {
|
|||
- (UIViewController *)topController
|
||||
{
|
||||
[MWMFrameworkListener removeObserver:self];
|
||||
[MWMSearch removeObserver:self.tableViewController];
|
||||
self.noMapsController = nil;
|
||||
switch (self.state)
|
||||
{
|
||||
|
@ -402,7 +401,6 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerActionBarState) {
|
|||
[MWMFrameworkListener addObserver:self];
|
||||
return self.noMapsController;
|
||||
case MWMSearchManagerStateTableSearch:
|
||||
[MWMSearch addObserver:self.tableViewController];
|
||||
return self.tableViewController;
|
||||
case MWMSearchManagerStateMapSearch: return self.tableViewController;
|
||||
}
|
||||
|
|
|
@ -22,10 +22,18 @@
|
|||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
_delegate = delegate;
|
||||
[MWMSearch addObserver:self];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[MWMSearch removeObserver:self];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
|
Loading…
Add table
Reference in a new issue