forked from mirrors/linphone-iphone
fix crash: IASKAppSettingsView is load before app entering foreground
This commit is contained in:
parent
b4d3992d25
commit
e06da76068
2 changed files with 16 additions and 11 deletions
|
|
@ -196,18 +196,23 @@
|
|||
- (IASKSettingsReader *)settingsReader {
|
||||
IASKSettingsReader *r = [super settingsReader];
|
||||
NSMutableArray *dataSource = [NSMutableArray arrayWithArray:[r dataSource]];
|
||||
for (int i = 0; i < [dataSource count]; ++i) {
|
||||
NSMutableArray *specifiers = [NSMutableArray arrayWithArray:[dataSource objectAtIndex:i]];
|
||||
for (int j = 0; j < [specifiers count]; ++j) {
|
||||
id sp = [specifiers objectAtIndex:j];
|
||||
if ([sp isKindOfClass:[IASKSpecifier class]]) {
|
||||
sp = [SettingsView filterSpecifier:sp];
|
||||
if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground) {
|
||||
for (int i = 0; i < [dataSource count]; ++i) {
|
||||
NSMutableArray *specifiers = [NSMutableArray arrayWithArray:[dataSource objectAtIndex:i]];
|
||||
for (int j = 0; j < [specifiers count]; ++j) {
|
||||
id sp = [specifiers objectAtIndex:j];
|
||||
if ([sp isKindOfClass:[IASKSpecifier class]]) {
|
||||
sp = [SettingsView filterSpecifier:sp];
|
||||
}
|
||||
[specifiers replaceObjectAtIndex:j withObject:sp];
|
||||
}
|
||||
[specifiers replaceObjectAtIndex:j withObject:sp];
|
||||
}
|
||||
|
||||
[dataSource replaceObjectAtIndex:i withObject:specifiers];
|
||||
[dataSource replaceObjectAtIndex:i withObject:specifiers];
|
||||
}
|
||||
} else {
|
||||
NSLog(@"Application is in background, linphonecore is off, skiping filter specifier.");
|
||||
}
|
||||
|
||||
[r setDataSource:dataSource];
|
||||
return r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,8 +242,8 @@ CGRect IASKCGRectSwap(CGRect rect);
|
|||
[super viewDidDisappear:animated];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
return YES;
|
||||
- (BOOL)shouldAutorotate {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue