forked from mirrors/linphone-iphone
49 lines
1 KiB
Objective-C
49 lines
1 KiB
Objective-C
//
|
|
// LogsViewController.m
|
|
// linphone
|
|
//
|
|
// Created by Guillaume BIENKOWSKI on 01/06/2014.
|
|
//
|
|
//
|
|
|
|
#import "LogsView.h"
|
|
#import "MasterView.h"
|
|
|
|
@interface LogsView () {
|
|
NSString *txt;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation LogsView
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
}
|
|
|
|
- (void)viewDidAppear:(BOOL)animated {
|
|
self.tview.textContainer.lineBreakMode = NSLineBreakByClipping;
|
|
self.tview.text = [lastLogs componentsJoinedByString:@"\n"];
|
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
selector:@selector(updateLogs:)
|
|
name:kLogsUpdateNotification
|
|
object:nil];
|
|
}
|
|
|
|
- (void)viewDidDisappear:(BOOL)animated {
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
}
|
|
|
|
- (IBAction)clearLogs:(id)sender {
|
|
|
|
self.tview.text = nil;
|
|
}
|
|
|
|
- (void)updateLogs:(NSNotification *)notif {
|
|
NSArray *newLogs = [notif.userInfo objectForKey:@"newlogs"];
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
self.tview.text = [self.tview.text stringByAppendingString:[newLogs componentsJoinedByString:@"\n"]];
|
|
});
|
|
}
|
|
|
|
@end
|