I wrote up a bug report that got tracked and closed without a real
fix. (The fix was unrelated, making non-business emails available in
the rhocontact)
The issue is that label will return nil if you are on a device that is
being synchronized through exchange. Here's a quick fix.
--- a/platform/iphone/Classes/Phonebook/phonebook.m
+++ b/platform/iphone/Classes/Phonebook/phonebook.m
@@ -123,7 +123,7 @@ static void _addEmailToHash(VALUE hash,ABRecordRef ref) {
int num_phones = ABMultiValueGetCount(emails);
for (int n = 0; n < num_phones; n++) {
CFStringRef label =
ABMultiValueCopyLabelAtIndex(emails,n);
-
if(CFStringCompare(label,kABWorkLabel,0)==kCFCompareEqualTo) {
+ if(label == nil ||
CFStringCompare(label,kABWorkLabel,0)==kCFCompareEqualTo) {
_addPropertyToHash(hash,RUBY_PB_EMAIL_ADDRESS,
ABMultiValueCopyValueAtIndex(emails,n));
} else
if(CFStringCompare(label,kABHomeLabel,0)==kCFCompareEqualTo) {
--
Brad Midgley