[ios] Renamed description property to notes to avoid conflict with default NSObject.description property

This commit is contained in:
Alex Zolotarev 2013-04-15 21:23:10 +03:00 committed by Alex Zolotarev
parent 4f89852900
commit d7593f076d
6 changed files with 19 additions and 19 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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;
}

View file

@ -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];
}

View file

@ -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)
{

View file

@ -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()];