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
path: root/iphone
diff options
context:
space:
mode:
authorKirill Zhdanovich <kzhdanovich@gmail.com>2013-02-15 19:53:19 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:49:49 +0300
commit97f0cc7643e026de5fb4b292692ebe32641213c9 (patch)
tree26e7ec911f20b3ee703e7ca0df2c6904bece6b57 /iphone
parent181a26c3139ada4262db173389d8f8365a2cd335 (diff)
[iOS]Search interface fix
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/Classes/SearchVC.mm24
1 files changed, 2 insertions, 22 deletions
diff --git a/iphone/Maps/Classes/SearchVC.mm b/iphone/Maps/Classes/SearchVC.mm
index 1632d52a27..e32e30a009 100644
--- a/iphone/Maps/Classes/SearchVC.mm
+++ b/iphone/Maps/Classes/SearchVC.mm
@@ -284,7 +284,6 @@ static void OnSearchResultCallback(search::Results const & res)
m_searchBar.selectedScopeButtonIndex = scopeSection;
[self proceedSearchWithString:lastSearchRequest andForceSearch:YES];
}
-
[super viewWillAppear:animated];
}
@@ -315,7 +314,6 @@ static void OnSearchResultCallback(search::Results const & res)
numberOfRowsInEmptySearch = 0;
[lastSearchRequest release];
lastSearchRequest = [[NSString alloc] initWithString:m_searchBar.text];
- [self clearCacheResults];
[self proceedSearchWithString:m_searchBar.text andForceSearch:NO];
}
@@ -376,7 +374,7 @@ static void OnSearchResultCallback(search::Results const & res)
return cell;
}
//No search results
- if ([m_searchBar.text length] != 0 && ![[_searchResults objectAtIndex:scopeSection] getCount])
+ if ([m_searchBar.text length] != 0 && ![[_searchResults objectAtIndex:scopeSection] getCount] && numberOfRowsInEmptySearch)
{
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"NoResultsCell"];
if (cell == nil)
@@ -580,7 +578,6 @@ void setSearchType(search::SearchParams& params)
if (m_framework->Search(params))
{
- [self clearCacheResults];
numberOfRowsInEmptySearch = 0;
[self showIndicator];
}
@@ -648,14 +645,7 @@ void setSearchType(search::SearchParams& params)
{
scopeSection = selectedScope;
numberOfRowsInEmptySearch = 0;
- if (![[_searchResults objectAtIndex:selectedScope] getCount])
- {
- [self proceedSearchWithString:m_searchBar.text andForceSearch:NO];
- }
- else
- {
- [m_table reloadData];
- }
+ [self proceedSearchWithString:m_searchBar.text andForceSearch:YES];
}
-(void)setSearchBarHeight
@@ -670,18 +660,8 @@ void setSearchType(search::SearchParams& params)
[self onCloseButton:nil];
}
--(void)clearCacheResults
-{
- for (int i = 0; i < [_searchResults count];++i)
- {
- [_searchResults replaceObjectAtIndex:i withObject:[[[ResultsWrapper alloc] init]autorelease]];
- }
-}
-
-(void)proceedSearchWithString:(NSString *)searchText andForceSearch:(BOOL)forceSearch
{
- // Clear old results immediately
- [_searchResults replaceObjectAtIndex:scopeSection withObject:[[[ResultsWrapper alloc] init]autorelease]];
[m_table reloadData];
if (![searchText length])
return;