Re: Addressbook api [SOLVED]
Re: Addressbook api [SOLVED]
- Subject: Re: Addressbook api [SOLVED]
- From: Mark Steinberg <email@hidden>
- Date: Thu, 5 Sep 2002 22:55:07 -0400
Thanks Henry!
NSNumber *intProperty = [NSNumber numberWithInt:
kABIntegerProperty];
NSDictionary *newProperty = [NSDictionary
dictionaryWithObjectsAndKeys: intProperty, @"myNewID", nil, nil];
i = [ABPerson addPropertiesAndTypes:newProperty];
On Thursday, September 5, 2002, at 10:36 PM, Mark Steinberg wrote:
Well, that previous email was embarrassing. I'm much closer now but I
am still getting one runtime error I hope someone can help me with.
The Error:
2002-09-05 22:06:32.742 addressbooks[18372] -[ABAddressBook
_doAddPropertiesAndTypes:needsReadWriteMode:registerDataTypes:]
mkDataType for myNewID not recognized
The Code:
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int i=12345;
ABAddressBook *theBook;
theBook = [ABAddressBook sharedAddressBook];
NSMutableDictionary *addedProperties = [NSMutableDictionary
dictionary];
[addedProperties setObject:@"kABIntegerProperty" forKey:@"myNewID"];
i = [ABPerson addPropertiesAndTypes:addedProperties];
if (i){
[theBook save];
ABPerson *person;
NSEnumerator *enumerator = [[theBook people] objectEnumerator];
while (person = [enumerator nextObject])
{
i++;
[person setValue:[[NSNumber numberWithInt:i] stringValue]
forProperty: @"myNewID"];
}
[theBook save];
}
[pool release];
return 0;
}
TIA
Mark
On Thursday, September 5, 2002, at 03:55 PM, Mark Steinberg wrote:
Does anyone have any examples of adding a property to the addressbook?
TIA
Mark
--
Mark Steinberg
Textile Technologies LLC
http://www.textiletech.com
_______________________________________________
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.
--
Mark Steinberg
Textile Technologies LLC
http://www.textiletech.com
_______________________________________________
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.
--
Mark Steinberg
Textile Technologies LLC
http://www.textiletech.com
_______________________________________________
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.