From d7593f076dd9cbeff7473d3732cf766e7389a472 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 15 Apr 2013 21:23:10 +0300 Subject: [PATCH] [ios] Renamed description property to notes to avoid conflict with default NSObject.description property --- iphone/Maps/Bookmarks/BalloonView.h | 4 ++-- iphone/Maps/Bookmarks/BalloonView.mm | 12 ++++++------ iphone/Maps/Bookmarks/EditDescriptionVC.h | 2 +- iphone/Maps/Bookmarks/EditDescriptionVC.mm | 4 ++-- iphone/Maps/Bookmarks/PlacePageVC.mm | 8 ++++---- iphone/Maps/Classes/MapViewController.mm | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/iphone/Maps/Bookmarks/BalloonView.h b/iphone/Maps/Bookmarks/BalloonView.h index 89c70749a5..0aa8cf1875 100644 --- a/iphone/Maps/Bookmarks/BalloonView.h +++ b/iphone/Maps/Bookmarks/BalloonView.h @@ -10,8 +10,8 @@ } @property(nonatomic, retain) NSString * title; -// Currently displays bookmark description -@property(nonatomic, retain) NSString * description; +// Currently displays bookmark description (notes) +@property(nonatomic, retain) NSString * notes; // Contains feature type(s) //@property(nonatomic, retain) NSString * type; @property(nonatomic, retain) UIImageView * pinImage; diff --git a/iphone/Maps/Bookmarks/BalloonView.mm b/iphone/Maps/Bookmarks/BalloonView.mm index 2eb358fe59..2f6f93546d 100644 --- a/iphone/Maps/Bookmarks/BalloonView.mm +++ b/iphone/Maps/Bookmarks/BalloonView.mm @@ -11,7 +11,7 @@ @synthesize globalPosition; @synthesize title; -@synthesize description; +@synthesize notes; //@synthesize type; @synthesize pinImage; @synthesize color; @@ -65,7 +65,7 @@ self.color = nil; self.setName = nil; self.title = nil; - self.description = nil; + self.notes = nil; // self.type = nil; [super dealloc]; } @@ -156,7 +156,7 @@ [view addSubview:self.pinImage]; -// m_titleView.image = [[self createPopupImageWithName:self.title andAddress:self.description] autorelease]; +// m_titleView.image = [[self createPopupImageWithName:self.title andAddress:self.notes] autorelease]; CGSize const s = m_titleView.bounds.size; m_titleView.frame = CGRectMake(pt.x, pt.y, 1, 1); @@ -216,7 +216,7 @@ id old = title; title = [newTitle retain]; [old release]; - m_titleView.image = [self createPopupImageWithTitle:newTitle andDescription:description]; + m_titleView.image = [self createPopupImageWithTitle:newTitle andDescription:notes]; [m_titleView sizeToFit]; } @@ -225,8 +225,8 @@ Framework & f = GetFramework(); Bookmark bm(m2::PointD(globalPosition.x, globalPosition.y), [title UTF8String], [color UTF8String]); - if (description) - bm.SetDescription([description UTF8String]); + if (notes) + bm.SetDescription([notes UTF8String]); f.GetBmCategory(editedBookmark.first)->ReplaceBookmark(editedBookmark.second, bm); BookmarkCategory * cat = f.GetBmCategory(editedBookmark.first); diff --git a/iphone/Maps/Bookmarks/EditDescriptionVC.h b/iphone/Maps/Bookmarks/EditDescriptionVC.h index 4ae4b02049..f0edaec663 100644 --- a/iphone/Maps/Bookmarks/EditDescriptionVC.h +++ b/iphone/Maps/Bookmarks/EditDescriptionVC.h @@ -5,7 +5,7 @@ @interface EditDescriptionVC : UIViewController { // @TODO store as a property to retain reference - // Used to pass description for editing + // Used to pass description (notes) for editing BalloonView * m_balloon; } diff --git a/iphone/Maps/Bookmarks/EditDescriptionVC.mm b/iphone/Maps/Bookmarks/EditDescriptionVC.mm index 1c4547f456..56703eb0bb 100644 --- a/iphone/Maps/Bookmarks/EditDescriptionVC.mm +++ b/iphone/Maps/Bookmarks/EditDescriptionVC.mm @@ -39,14 +39,14 @@ { [self registerForKeyboardNotifications]; UITextView * tv = (UITextView *)self.view; - tv.text = m_balloon.description; + tv.text = m_balloon.notes; [tv becomeFirstResponder]; } - (void)viewWillDisappear:(BOOL)animated { UITextView * tv = (UITextView *)self.view; - m_balloon.description = tv.text.length ? tv.text : nil; + m_balloon.notes = tv.text.length ? tv.text : nil; [tv resignFirstResponder]; [self unregisterKeyboardNotifications]; } diff --git a/iphone/Maps/Bookmarks/PlacePageVC.mm b/iphone/Maps/Bookmarks/PlacePageVC.mm index 4b9f378d79..63e877815d 100644 --- a/iphone/Maps/Bookmarks/PlacePageVC.mm +++ b/iphone/Maps/Bookmarks/PlacePageVC.mm @@ -71,8 +71,8 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { if ([self canShare]) - return 3; - return 2; + return 4; + return 3; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section @@ -82,6 +82,7 @@ case 0: return 3; case 1: return 1; case 2: return 1; + case 3: return 1; default: return 0; } } @@ -184,8 +185,7 @@ } } else - { - // 2nd section with add/remove pin buttons + { cell = [tableView dequeueReusableCellWithIdentifier:@"removePinCellId"]; if (!cell) { diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 86395da487..27ed8e7e7d 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -294,9 +294,9 @@ const long long LITE_IDL = 431183278L; res = NSLocalizedString(@"dropped_pin", nil); // Reset description BEFORE title, as title's setter also takes it into an account for Balloon text generation - m_balloonView.description = nil; + m_balloonView.notes = nil; m_balloonView.title = res; - //m_balloonView.description = [NSString stringWithUTF8String:info.FormatAddress().c_str()]; + //m_balloonView.notes = [NSString stringWithUTF8String:info.FormatAddress().c_str()]; //m_balloonView.type = [NSString stringWithUTF8String:info.FormatTypes().c_str()]; } @@ -713,9 +713,9 @@ NSInteger compareAddress(id l, id r, void * context) // Reset description BEFORE title, as title's setter also takes it into an account for Balloon text generation string const & descr = bm->GetDescription(); if (!descr.empty()) - m_balloonView.description = [NSString stringWithUTF8String:descr.c_str()]; + m_balloonView.notes = [NSString stringWithUTF8String:descr.c_str()]; else - m_balloonView.description = nil; + m_balloonView.notes = nil; m_balloonView.title = [NSString stringWithUTF8String:bm->GetName().c_str()]; m_balloonView.color = [NSString stringWithUTF8String:bm->GetType().c_str()]; m_balloonView.setName = [NSString stringWithUTF8String:cat->GetName().c_str()];