From cfc535083ff1fa4e8966469c8f3dd61549796f52 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Tue, 4 Sep 2012 01:13:20 +0300 Subject: [PATCH] [ios] Fixed not appearing Edit button --- iphone/Maps/Bookmarks/BookmarksVC.mm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/iphone/Maps/Bookmarks/BookmarksVC.mm b/iphone/Maps/Bookmarks/BookmarksVC.mm index b8677ca001..90a4814955 100644 --- a/iphone/Maps/Bookmarks/BookmarksVC.mm +++ b/iphone/Maps/Bookmarks/BookmarksVC.mm @@ -19,13 +19,12 @@ m_locationManager = [MapsAppDelegate theApp].m_locationManager; m_balloon = view; self.title = NSLocalizedString(@"bookmarks", @"Boormarks - dialog title"); - - self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"maps", @"Bookmarks - Close bookmarks button") style: UIBarButtonItemStyleDone - target:self action:@selector(onCloseButton:)] autorelease]; - // Display Edit button only if table is not empty - BookmarkCategory * cat = GetFramework().GetBmCategory([m_balloon.setName UTF8String]); - if (cat && cat->GetBookmarksCount()) - self.navigationItem.rightBarButtonItem = self.editButtonItem; + + self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] + initWithTitle:NSLocalizedString(@"maps", @"Bookmarks - Close bookmarks button") + style: UIBarButtonItemStyleDone + target:self + action:@selector(onCloseButton:)] autorelease]; } return self; } @@ -297,6 +296,14 @@ - (void)viewWillAppear:(BOOL)animated { [m_locationManager start:self]; + + // Display Edit button only if table is not empty + BookmarkCategory * cat = GetFramework().GetBmCategory([m_balloon.setName UTF8String]); + if (cat && cat->GetBookmarksCount()) + self.navigationItem.rightBarButtonItem = self.editButtonItem; + else + self.navigationItem.rightBarButtonItem = nil; + [super viewWillAppear:animated]; }