From c442f216deffc515c1c82bbfaad6d50b5931475d Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 27 Oct 2011 14:58:21 +0300 Subject: [PATCH] [ios] Possibly closes #369, countries table was empty because countries were not initialized --- iphone/Maps/Settings/SettingsManager.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Settings/SettingsManager.mm b/iphone/Maps/Settings/SettingsManager.mm index cf2025c7e2..edfaaa5258 100644 --- a/iphone/Maps/Settings/SettingsManager.mm +++ b/iphone/Maps/Settings/SettingsManager.mm @@ -54,9 +54,8 @@ using namespace storage; CountriesViewController * countriesController = [[[CountriesViewController alloc] initWithStorage:*m_storage andIndex:TIndex() andHeader:@"Download"] autorelease]; m_navigationController = [[UINavigationController alloc] initWithRootViewController:countriesController]; - [prevController presentModalViewController:m_navigationController animated:YES]; - // Subscribe to storage callbacks. + // Subscribe to storage callbacks AND load country names after calling Storage::Subscribe() { // tricky boost::bind for objC class methods typedef void (*TChangeFunc)(id, SEL, TIndex const &); @@ -69,6 +68,8 @@ using namespace storage; m_storage->Subscribe(bind(changeImpl, self, changeSel, _1), bind(progressImpl, self, progressSel, _1, _2)); } + // display controller only when countries are loaded + [prevController presentModalViewController:m_navigationController animated:YES]; } // Hides all opened settings windows