Archiving ABPerson
Archiving ABPerson
- Subject: Archiving ABPerson
- From: Scott Ahten <email@hidden>
- Date: Fri, 7 May 2004 13:21:29 -0400
Hello everyone,
I'm trying to create a keyed archive that contains a NSArray of
ABPersons. I am archiving the array so it can transmitted across a
network to multiple users. At the moment, I'm just trying to archive an
ABPerson. My test code looks something like this...
ABAddressBook * ab = [ABAddressBook sharedAddressBook];
ABPerson * person = [ab me];
NSMutableData *representationToSend;
NSKeyedArchiver *archiver;
representationToSend = [NSMutableData data];
archiver = [[NSKeyedArchiver alloc]
initForWritingWithMutable
Data:representationToSend];
[archiver encodeObject:person forKey:@"abPerson"];
[archiver finishEncoding];
[archiver release];
This code returns the following error...
2004-05-07 12:43:02.037 Picture Sharing[3501] *** -[ABPerson
encodeWithCoder:]: selector not recognized
2004-05-07 12:43:02.037 Picture Sharing[3501] Exception raised during
posting of notification. Ignored. exception: *** -[ABPerson
encodeWithCoder:]: selector not recognized
Checking the headers, I found that ABPerson does not implement the
NSCoding interface. I assume lack of archive support is intentional due
to issues with it's implementation. Since I do not have the source for
ABPerson class, is it possible to extend or modify it to support
Archiving?
Any examples or resources would be greatly appreciated.
Thanks,
- Scott
- - - - -
:: email@hidden
::
http://www.pixelfreak.net
- - - - -
_______________________________________________
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.