• 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
Archiving ABPerson
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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] initForWritingWithMutableData: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.


  • Follow-Ups:
    • Re: Archiving ABPerson
      • From: Vince DeMarco <email@hidden>
    • Re: Archiving ABPerson
      • From: Aaron Tuller <email@hidden>
  • Prev by Date: Re: cocoa-dev digest, Vol 2 #4140 - 15 msgs
  • Next by Date: Handling Undo/Redo in KVC To-Many Accessors
  • Previous by thread: Re: Instance Variable access
  • Next by thread: Re: Archiving ABPerson
  • Index(es):
    • Date
    • Thread