私のアプリでアドレス帳を使用していますバックグラウンドスレッドでアドレス帳のデータを取得しています。 。次のエラーでアプリがクラッシュ:私のアプリがバックグラウンドから起動した後、私のアプリはUIApplicationDidBecomeActiveNotificationを受信したときApp AppName [5811]がロックされたシステムファイルで中断されました:AddressBook.sqlitedb "
Application Specific Information:
[2786] was suspended with locked system files:
/private/var/mobile/Library/AddressBook/AddressBook.sqlitedb
、私はバックグラウンドスレッドでアドレス帳データを取得しています。ここに私のコードは
ある// In my ViewController.m
- (void)viewDidLoad
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appLaunchedFromBackground:)
name:UIApplicationDidBecomeActiveNotification object:nil];
// Some more code
}
-(void)appLaunchedFromBackground:(NSNotification *) notification {
NSLog(@"In appLaunchedFromBackground");
[self performSelectorInBackground:@selector(getUpdatedAddressBookData) withObject:nil];
}
-(void)getUpdatedAddressBookData {
NSLog(@"In %s",__PRETTY_FUNCTION__);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
AddressBook *addBook = [[AddressBook alloc]init];
[addBook fetchAddressBookDataInBackground];
[addBook release];
[pool drain];
}
はまた、私はCALLを持っています私のアプリの機能。 CALLの終了後に私のアプリケーション&からnoをseelctedすると私は再び私のアプリケーションがクラッシュする2回のために私のアプリケーションを起動します。 CALLの場合、次のコードを使用しました:
+(void)makeCallToSelectedContact:(NSString*)phoneNo{
NSMutableString *phoneNumber = [NSMutableString stringWithString:phoneNo];
[phoneNumber replaceOccurrencesOfString:@" "
withString:@""
options:NSLiteralSearch
range:NSMakeRange(0, [phoneNumber length])];
[phoneNumber replaceOccurrencesOfString:@"("
withString:@""
options:NSLiteralSearch
range:NSMakeRange(0, [phoneNumber length])];
[phoneNumber replaceOccurrencesOfString:@")"
withString:@""
options:NSLiteralSearch
range:NSMakeRange(0, [phoneNumber length])];
NSLog(@"phoneNumber => %@",phoneNumber);
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneNumber]]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneNumber]]];
}
else {
NSLog(@"Unable to open");
[self showAlertWithTitle:@"Alert" andMessage:@"This Device Doesn't Support Call Functionality"];
}
}
どのようにクラッシュする問題を解決できますか?どのような助けも高く評価されます。ありがとう。
解決策はまだ見つかりましたか? –
いいえ、これは何も見つかりませんでした – iOSAppDev