I understand that ABAddressBook methods are concerned with ABPerson and ABGroup 
entities, subclasses of ABRecord.
However, the ABMultiValue collections are less intuitive. Among these are 
stored the (potentially) multiple instances of addresses, phone numbers and 
email addresses.  For each instance of user supplied data, a multiValue object 
can store - in properties keyed with kABXxxx keys - arbitrary labels: home, 
work, iPhone, mobile, etc.   The documentation leaves much to be desired, but 
in particular, I cannot glean how to retrieve a user-supplied string from a 
given multiValue object.

Some code: 

Given some address, stored in an ABMultiValue object, such that:  

- (void) unwrapMV:(ABMultiValue*)mv atIndex:(int)index {

        NSString *      _uuid       = [mv identifierAtIndex:index];
        NSString *      _label      = [mv labelForIdentifier:[mv 
identifierAtIndex:index]];
        NSDictionary *  _dict       = [mv valueAtIndex:index];
                                // am I the identified primary entry?
        BOOL            _primary    = ([mv primaryIdentifier] == self.uuid)? 
YES: NO; 

        NSLog( @"%@", _label) ;
}

produces  _$!<Home>!$_, 
or one of the other variants of the actual value of the key, not the value it 
refers to.

Clearly I am failing to understand where these strings are being stored.

Erik Stainsby
erik.stain...@roaringsky.ca


On 2012-09-13, at 9:04 PM, Jerry Krinock <je...@ieee.org> wrote:

> 
> On 2012 Sep 13, at 19:45, Erik Stainsby <erik.stain...@roaringsky.ca> wrote:
> 
>> So the AddressBook framework's xxxLabel keys render out as strings encoded 
>> like so: _$!<Home>!$_, _$!<Work>!$_, _$!<Mobile>!$_   Is there framework 
>> method I am meant to use with the property keys kABHomeLabel, kABWorkLabel, 
>> etc, to render a legible text outcome 
> 
> Maybe you're looking for -[ABRecord valueForProperty:].  Note that 
> ABAddressBook methods typically return ABPerson objects, and ABPerson 
> inherits from ABRecord.
> 
> If that doesn't explain it, post some code.
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/erik.stainsby%40roaringsky.ca
> 
> This email sent to erik.stain...@roaringsky.ca

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to