Enumerating Address Book properties
Enumerating Address Book properties
- Subject: Enumerating Address Book properties
- From: Denis Stanton <email@hidden>
- Date: Sat, 22 Feb 2003 20:32:22 +1300
Can anyone tell me if there is a way to obtain the properties of an
Address Book entry? Address Books contain People and Group records
where ABPeople and ABGroup are each subclasses of ABRecord. ABRecords
have properties, like First Name or Telephone Number.
I want to get a list of all the properties that a given person has
values for.
ABRecord defines a method for finding a value of a Property if I know
the property's name:
- (id)valueForProperty:(NSString *)property;
but what happens if I don't know all the properties that have been
entered for a person?
It is possible to obtain a list of the standard properties using
ABPerson's properties method
+ (NSArray *)properties;
but that only tells me the properties that a given person **might**
have. As far as I can tell it won't tell me if any person has actually
assigned a value for each of these properties and it won't inform me if
some other program has defined a custom property for some of the people
in my Address Book.
I was assuming that the properties were stored in an NSDictionary,
which led me to the NSDictionary keyEnumerator method, but I can't send
keyEnumerator to an ABPerson object. Presumably ABPerson is more than
just a dictionary. If the properties are in a dictionary I can't figure
out how to get at it in a way that will let me discover which
properties have been set for each person
I hope this rambling description makes sense. As you will have
guessed, I'm still feeling my way into Objective-C.
Denis Stanton
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.