Alterplay / APAddressBook

Easy access to iOS address book
MIT License
1.38k stars 193 forks source link

Set access even when the ABAddressBookRef isn't initialized #100

Closed ggurantz closed 9 years ago

ggurantz commented 9 years ago

If permissions are disabled, then refWrapper.error will be non nil. Currently, this will prevent self.access from being initialized. Because of this, later in loadContactsOnQueue:completion:, when [self.access requestAccessWithCompletion:] is called it will be a no-op and thus prevent the callback from ever being called.

In other words, -loadContacts: will never call its completion block when permissions are disabled.

This fixes the issue by initializing self.access regardless of whether address book initialization errors.

belkevich commented 9 years ago

Merged. Update to 0.2.1