RHAddressBook
RHAddressBook copied to clipboard
Crash when Addressbook changes.
My App is crashing when the addressbook is changed. How do I debug this?
AddressBook
ABAddressBookHasUnsavedChanges + 79
1
AddressBook
ABLogAPIUsage + 26
2
RHAddressBook.m line 1055
34-[RHAddressBook hasUnsavedChanges]_block_invoke
3
libdispatch.dylib
_dispatch_client_callout + 22
4
libdispatch.dylib
_dispatch_barrier_sync_f_slow + 230
5
RHAddressBook.m line 1054
-[RHAddressBook hasUnsavedChanges]
6
RHAddressBook.m line 1069
-[RHAddressBook addressBookExternallyChanged:]
7
CoreFoundation
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
8
CoreFoundation
_CFXNotificationPost + 1720
9
Foundation
-[NSNotificationCenter postNotificationName:object:userInfo:] + 72
10
Foundation
-[NSNotificationCenter postNotificationName:object:] + 30
11 libdispatch.dylib
_dispatch_call_block_and_release + 10
19 UIKit
UIApplicationMain + 1136
20
main.m line 16
main
Have the same crash.
Same problem here
Happens to me after I do a [person setImage:image]; and then [addressBook save];
crash is on -(BOOL)hasUnsavedChanges{ in RHAddressBook.m
any progress with that?
Are you using ARC? CocoaPods? What version/s of iOS? What library Version? Device or Simulator? All of these things would be useful to enable further debugging. Full crash log would also be useful (with all threads).
ARC - Yes CocoaPods - Yes iOS - 7.1.1 Library Version - Using RHAddressBook (1.1.1) Crash on Device. Thanks!
Attached from Crashlytics:

I see that there is a new version (1.2.0) of RHAddressBook, and some changes have been made to the hasUnsavedChanges and revert methods.
Do these fix this issue? Would you mind pushing the version to 1.2.0 to CocoaPods?
Unfortunately i've had a report that the changes didn't actually fix the issue. I've never actually been able to reproduce the crash myself, so debugging the issue is made harder than would normally be the case..
Any chance you could put together a sample project that causes the crash to occur?
Happy to push to cocoapods, however ill hold off until i know the crash is fixed..
In my app, I couldn't get it to reproduce consistently. The way I fixed it was to create a sharedInstance of RHAddressBook for the app.
On Fri, Jul 25, 2014 at 11:55 AM, Richard Heard [email protected] wrote:
Unfortunately i've had a report that the changes didn't actually fix the issue. I've never actually been able to reproduce the crash myself, so debugging the issue is made harder than would normally be the case..
Any chance you could put together a sample project that causes the crash to occur?
Happy to push to cocoapods, however ill hold off until i know the crash is fixed..
— Reply to this email directly or view it on GitHub https://github.com/heardrwt/RHAddressBook/issues/56#issuecomment-50189957 .
-x
Hmmm... interesting.. I wonder if the last strong reference to the actual addressbook is being released.. Perhaps on receipt of a change notification..
In my app I have also not been able to reproduce it consistently. Will try out the sharedInstance fix and report back. Will also try to find out what triggers it. Just the thought of going back to using straight C with ABAddressBook book sends shivers down my spine :cold_sweat:
@heardrwt I was able to find fairly reproducible steps for this that might help. Basically if I keep going to the settings app and toggle icloud contacts off->on (and delete from the phone) then come back to my app, it will frequently crash. This can be caught in the zombies tool using the simulator. Happy to give any more information. Thanks!