• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: kABHomeLabel … and companions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kABHomeLabel … and companions


  • Subject: Re: kABHomeLabel … and companions
  • From: Richard Heard <email@hidden>
  • Date: Thu, 13 Sep 2012 22:44:38 -0700

On iOS you would be looking for ABPersonCopyLocalizedPropertyName() on the Mac you would be looking for ABCopyLocalizedPropertyOrLabel().

-Richard


On 13/09/2012, at 9:33:06 PM, Erik Stainsby <email@hidden> wrote:

> 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
> email@hidden
>
>
> On 2012-09-13, at 9:04 PM, Jerry Krinock <email@hidden> wrote:
>
>>
>> On 2012 Sep 13, at 19:45, Erik Stainsby <email@hidden> 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 (email@hidden)
>>
>> 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:
>>
>> This email sent to email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >kABHomeLabel … and companions (From: Erik Stainsby <email@hidden>)
 >Re: kABHomeLabel … and companions (From: Jerry Krinock <email@hidden>)
 >Re: kABHomeLabel … and companions (From: Erik Stainsby <email@hidden>)

  • Prev by Date: Re: Autosave in place - common use case that makes me hate it
  • Next by Date: Share NSView between processes
  • Previous by thread: Re: kABHomeLabel … and companions
  • Next by thread: Re: kABHomeLabel … and companions
  • Index(es):
    • Date
    • Thread