mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 01:39:20 +00:00
History details view: Create only one time the date formatter
This commit is contained in:
parent
60055f2e7e
commit
4ae532b61a
2 changed files with 15 additions and 6 deletions
|
|
@ -26,6 +26,7 @@
|
|||
@interface HistoryDetailsViewController : UIViewController<UICompositeViewDelegate> {
|
||||
@private
|
||||
ABRecordRef contact;
|
||||
NSDateFormatter *dateFormatter;
|
||||
}
|
||||
@property (nonatomic, retain) IBOutlet UIImageView *avatarImage;
|
||||
@property (nonatomic, retain) IBOutlet UILabel *addressLabel;
|
||||
|
|
|
|||
|
|
@ -38,9 +38,23 @@
|
|||
|
||||
#pragma mark - LifeCycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"HistoryDetailsViewController" bundle:[NSBundle mainBundle]];
|
||||
if(self != nil) {
|
||||
dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
|
||||
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
|
||||
NSLocale *locale = [NSLocale currentLocale];
|
||||
[dateFormatter setLocale:locale];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
[dateFormatter release];
|
||||
|
||||
[avatarImage release];
|
||||
[addressLabel release];
|
||||
[dateLabel release];
|
||||
|
|
@ -221,13 +235,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
// Date
|
||||
NSDate *startData = [NSDate dateWithTimeIntervalSince1970:callLog->start_date_time];
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
|
||||
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
|
||||
NSLocale *locale = [NSLocale currentLocale];
|
||||
[dateFormatter setLocale:locale];
|
||||
[dateLabel setText:[dateFormatter stringFromDate:startData]];
|
||||
[dateFormatter release];
|
||||
|
||||
// Duration
|
||||
int duration = callLog->duration;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue