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

Subclassing NSKeyedArchiver


  • Subject: Subclassing NSKeyedArchiver
  • From: The Amazing Llama <email@hidden>
  • Date: Thu, 20 Feb 2003 23:32:46 -0800

I'm trying to write a class that will do hierarchal keyed coding, and save the results to a plist. I thought I was getting close, and then I tried archiving an array, when I suddenly stumbled across an exception popping up in the middle of my code.

I take a closer look, and lo and behold, NSArray calls a private method in NSKeyedArchiver, my superclass:

#0 0x90134e78 in CFArrayAppendValue
#1 0x90871a60 in -[NSKeyedArchiver _encodeArrayOfObjects:forKey:]
#2 0x908008bc in -[NSDictionary encodeWithCoder:]
#3 0x0000f3c8 in -[XMLArchiver encodeOnNewLevel:forKey:] at XMLArchiver.m:200

How should I go about circumventing this? I want to inherit from NSKeyedArchiver, because it keeps track of class substitutions and such for me. It also provides an API that suits my needs perfectly, and makes my class backwards compatible with all classes that have been written to handle keyed archiving.

But I'm 'not supposed' to override internal "private" methods, which is the only way I can see of getting around this. Is there a better way?

I suppose I could always dynamically substitute some home brew class for every NSArray, but that defeats some of the purpose of backwards-compatibility I was hoping for...

Seth A. Roby The Amazing Llama < mail or AIM me at tallama at mac dot com>
"Life is like an exploded clown. It's really funny until you figure out what just happened."
_______________________________________________
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.
  • Prev by Date: SIGPIPE while printing ! Please help !!
  • Next by Date: protocol used by SCNetworkCheckReachability
  • Previous by thread: Re: SIGPIPE while printing ! Please help !!
  • Next by thread: protocol used by SCNetworkCheckReachability
  • Index(es):
    • Date
    • Thread