ANN: Address Book helper library
ANN: Address Book helper library
- Subject: ANN: Address Book helper library
- From: Joseph Jones <email@hidden>
- Date: Mon, 29 Sep 2003 21:53:49 -0700
Hi,
In our continuing effort to help the Mac OS X development community,
JTech Softworks, Inc. is proud to announce the release the source to a
small Address Book helper. This code is a set of interface extensions
to the ABMultiValue, ABRecord and ABPerson classes provided by the base
framework that make property access and writing easier and more "Cocoa"
like. Since they are interface extensions and not derivations, you only
work with an ABMultiValue, ABRecord or ABPerson object and call the
extended methods provided by this code.
A simple example of using these extensions:
ABAddressBook* book = [ABAddressBook sharedAddressBook];
ABPerson* person = [book me];
NSLog( [person fullName] );
NSLog( [person primaryEmail] );
NSLog( [NSString stringWithFormat:@"Work Email: %@", [person
workEmail]] );
NSLog( [NSString stringWithFormat:@"Home Email: %@", [person
homeEmail]] );
NSLog( [person primaryPhone] );
NSLog( [NSString stringWithFormat:@"Work Phone: %@", [person
workPhone]] );
NSLog( [NSString stringWithFormat:@"Home Phone: %@", [person
homePhone]] );
NSDictionary* primAddr = [person primaryAddress];
if ( primAddr )
{
NSLog ( [person streetFromAddress:primAddr] );
NSLog ( [person cityFromAddress:primAddr] );
NSLog ( [person stateFromAddress:primAddr] );
NSLog ( [person zipFromAddress:primAddr] );
NSLog ( [person countryFromAddress:primAddr] );
}
The code, plus a short example driver that includes the code above, can
be retrieved from the following URL:
http://www.jtechsoftworks.com/samples/JTAddressBook.sit
The download contains a full Cocoa Tool app that is both an example of
using the code as well a a quick test tool.
I hope people find this code useful. If so, a short note of recognition
in your application would be cool. :-)
If you extend the code or fix any bugs in it, please make sure you send
the changes to me so I can keep my source base up.
Thank you,
Joseph Jones
_______________________________________________
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.