Closed skparticles closed 7 years ago
May be you try to load contact images? Please, provide more code.
APAddressBook *addressBook = [[APAddressBook alloc] init];
addressBook.fieldsMask = APContactFieldAll;
addressBook.sortDescriptors = @[
[NSSortDescriptor sortDescriptorWithKey:@"name.firstName" ascending:YES],
[NSSortDescriptor sortDescriptorWithKey:@"name.lastName" ascending:YES]
];
dispatch_queue_t queue = dispatch_queue_create("background task", NULL);
[addressBook loadContactsOnQueue:queue completion:^(NSArray<APContact *> *contacts, NSError *error) {
//Crashing
}];
dispatch_queue_t queue = dispatch_queue_create("background task", NULL);
Try to store queue
in property.
Also, if you call some UI-interacting methods in completion
block, the app can crash. Use main queue to fix this
Thanks.
Feel free to reopen this issue if you still have problems
I have also tried 0.3.1 version with test device iPhone 6sPlus, It is crashing on loading contacts. I have no idea, why it is crashing.