Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Grechuhin <i.grechuhin@gmail.com>2016-03-18 13:32:24 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:56:56 +0300
commit0fafd66da8de6c555de26fb1abfec1f31f277065 (patch)
treee87ff3d1f60014202f882c50c278e76901942eb4
parentf56bc17cab3a89f95062d8a062849373cf37f160 (diff)
[ios] Fixed crash on search.
-rw-r--r--iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm2
-rw-r--r--iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm12
2 files changed, 3 insertions, 11 deletions
diff --git a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm
index 634f716ef9..d7a9a459e1 100644
--- a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm
+++ b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm
@@ -37,8 +37,6 @@ extern NSString * const kPlaceCellIdentifier;
[nsSearchCoutryIds addObject:nsCountryId];
nsSearchResults[nsCountryId] = @(it->GetString().c_str());
}
- if (nsSearchCoutryIds.count == 0)
- return nil;
self.searchCoutryIds = [nsSearchCoutryIds array];
self.searchMatchedResults = nsSearchResults;
}
diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm
index dea63d4b43..840052bf53 100644
--- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm
+++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm
@@ -138,16 +138,10 @@ using namespace storage;
__strong auto self = weakSelf;
if (!self || results.IsEndMarker())
return;
- MWMMapDownloaderDataSource * dataSource = self.defaultDataSource;
- if (results.GetCount() != 0)
+ self.searchDataSource = [[MWMMapDownloaderSearchDataSource alloc] initWithSearchResults:results delegate:self];
+ dispatch_async(dispatch_get_main_queue(), ^
{
- self.searchDataSource = [[MWMMapDownloaderSearchDataSource alloc] initWithSearchResults:results delegate:self];
- if (self.searchDataSource)
- dataSource = self.searchDataSource;
- }
- dispatch_async(dispatch_get_main_queue(), ^()
- {
- self.dataSource = dataSource;
+ self.dataSource = self.searchDataSource;
[self reloadTable];
});
};