, 내가하지만 어떻게든지 그것을 초기화하는 여러 가지 방법을 시도 내 애플 리케이션 냉동 또는 다른 무작위로 내 응용 프로그램 동결하는 것 :ABPeoplePickerNavigationController 내가 ABPeoplePickerNavigationController 좀비를 생성하고 내 응용 프로그램을 동결에 문제가
if([appDelegate testInternetConnection]){
ABPeoplePickerNavigationController *picker =[[ABPeoplePickerNavigationController alloc] init];
[picker setPeoplePickerDelegate:self];
[self presentViewController:picker animated:YES completion:nil ];
}else{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Internet Connection Error" message:@"This App needs internet in order to work, please make sure you are connected to a valid network" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
dispatch_async(dispatch_get_main_queue(), ^{
// Display/dismiss your alert
[alert show];
});
}
을 내가하지 내가 뭘 잘못하고 있는지 알지만 내 응용 프로그램을 에뮬레이터 외부로 또는 장치가 디버깅하지 않을 때 얼어 버릴 수 있습니다. 그 이유는 무엇입니까? 여기 -Update
내가 엑스 코드에 연결된 실행 때 정지하지 않는 지금 말했듯이 코어 데이터
#pragma mark Save data to Core Data Safely
-(void) saveData{
NSPersistentStoreCoordinator *mainThreadContextStoreCoordinator = [appDelegate persistentStoreCoordinator];
dispatch_queue_t request_queue = dispatch_queue_create("com.4Postcards.savingData", NULL);
dispatch_async(request_queue, ^{
// Create a new managed object context
// Set its persistent store coordinator
NSManagedObjectContext *newMoc = [[NSManagedObjectContext alloc] init];
[newMoc setPersistentStoreCoordinator:mainThreadContextStoreCoordinator];
// Register for context save changes notification
NSNotificationCenter *notify = [NSNotificationCenter defaultCenter];
[notify addObserver:self
selector:@selector(mergeChanges:)
name:NSManagedObjectContextDidSaveNotification
object:newMoc];
// Do the work
// Your method here
// Call save on context (this will send a save notification and call the method below)
NSError *error;
BOOL success = [newMoc save:&error];
if (!success)
NSLog(@"%@",error);
// Deal with error
});
}
- (void)mergeChanges:(NSNotification*)notification
{
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"Data Saved");
});
}
에 저장 사용하고 코드이지만, 분리 할 때 그렇습니다
당신이 응용 프로그램에서 coredata을 사용하는 ?? – Saad
연락처를 선택하기 위해 인터넷이 필요한 이유가 무엇입니까? – rmaddy
디버거를 사용하여 앱이 "고정 된 위치"를 확인해 보셨습니까? – rmaddy