diff --git a/Classes/APAddressBook.h b/Classes/APAddressBook.h index 52e2f01..5b6b438 100644 --- a/Classes/APAddressBook.h +++ b/Classes/APAddressBook.h @@ -20,6 +20,7 @@ + (APAddressBookAccess)access; - (void)loadContacts:(void (^)(NSArray *contacts, NSError *error))callbackBlock; -- (void)loadContacts:(dispatch_queue_t)completionQueue completion:(void (^)(NSArray *contacts, NSError *error))callbackBlock; +- (void)loadContactsOnQueue:(dispatch_queue_t)queue + completion:(void (^)(NSArray *contacts, NSError *error))completionBlock; @end diff --git a/Classes/APAddressBook.m b/Classes/APAddressBook.m index 4628e01..f004e92 100644 --- a/Classes/APAddressBook.m +++ b/Classes/APAddressBook.m @@ -64,10 +64,11 @@ + (APAddressBookAccess)access - (void)loadContacts:(void (^)(NSArray *contacts, NSError *error))callbackBlock { - [self loadContacts:dispatch_get_main_queue() completion:callbackBlock]; + [self loadContactsOnQueue:dispatch_get_main_queue() completion:callbackBlock]; } -- (void)loadContacts:(dispatch_queue_t)completionQueue completion:(void (^)(NSArray *contacts, NSError *error))callbackBlock; +- (void)loadContactsOnQueue:(dispatch_queue_t)queue + completion:(void (^)(NSArray *contacts, NSError *error))completionBlock; { APContactField fieldMask = self.fieldsMask; NSArray *descriptors = self.sortDescriptors; @@ -100,11 +101,11 @@ - (void)loadContacts:(dispatch_queue_t)completionQueue completion:(void (^)(NSAr error = (__bridge NSError *)errorRef; } - dispatch_async(completionQueue, ^ + dispatch_async(queue, ^ { - if (callbackBlock) + if (completionBlock) { - callbackBlock(array, error); + completionBlock(array, error); } }); });