Merge pull request #29 from deathbaba/searchFix

[iOS] Scroll to top fix
This commit is contained in:
Viktor Govako 2013-08-23 04:20:20 -07:00
commit 37c57e905d

View file

@ -179,9 +179,9 @@
m_storage.QueryArticleInfo([searchText UTF8String], self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude);
else
m_storage.QueryArticleInfo([searchText UTF8String]);
if ([searchText length])
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
[self.tableView reloadData];
if (m_storage.GetResultsCount() && [self.tableView numberOfRowsInSection:0])
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
#pragma mark - Utils methods