From cf0c478f2350a3d0840b7becc14a5cae6d41c203 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 24 Mar 2011 04:42:09 +0000 Subject: [PATCH] Fixed crash while downloading and pressing About Closed #157 --- iphone/Maps/Settings/SettingsManager.mm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Settings/SettingsManager.mm b/iphone/Maps/Settings/SettingsManager.mm index e12fca80c0..3380458325 100644 --- a/iphone/Maps/Settings/SettingsManager.mm +++ b/iphone/Maps/Settings/SettingsManager.mm @@ -24,13 +24,21 @@ using namespace storage; - (void) OnCountryChange: (TIndex const &) index { if (m_navController) - [(CountriesViewController *)m_navController.topViewController OnCountryChange: index]; + { + UIViewController * controller = m_navController.topViewController; + if ([controller respondsToSelector:@selector(OnCountryChange:)]) + [(CountriesViewController *)controller OnCountryChange: index]; + } } - (void) OnCountryDownload: (TIndex const &) index withProgress: (TDownloadProgress const &) progress { if (m_navController) - [(CountriesViewController *)m_navController.topViewController OnDownload: index withProgress: progress]; + { + UIViewController * controller = m_navController.topViewController; + if ([controller respondsToSelector:@selector(OnDownload:withProgress:)]) + [(CountriesViewController *)controller OnDownload: index withProgress: progress]; + } } - (void) OnUpdateCheck: (TUpdateResult) result withText: (string const &) text