• 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
A String of Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A String of Problems


  • Subject: A String of Problems
  • From: Herr Witten <email@hidden>
  • Date: Sun, 11 Jul 2004 02:53:12 -0400

I have a subclass of NSString that does not work correctly with
archiving; the subclass is the embedded type--where the data is held by
a normal NSString instance variable--and my NSCoding implementation
looks like this:

- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject: _string forKey: @"string"];
}
- (id)initWithCoder:(NSCoder *)coder
{
[self setString: [[coder decodeObjectForKey: @"string"] retain]];

return self;
}

Yet they don't seem to be called at all.

Also, my subclass is archived properly the first time. Then, when it is
unarchived, it is allocated as an NSCFString so that it is archived
again incorrectly and so that the program crashes when it is used as
the subclass.

Any help would be appreciated.

Herr Witten
_______________________________________________
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: A String of Problems
      • From: "Louis C. Sacha" <email@hidden>
  • Prev by Date: Re: XCode 1.2 via Software Update?
  • Next by Date: Implementing Cmd-key "tooltips" on controls?
  • Previous by thread: Re: Cocoa Bindings Info
  • Next by thread: Re: A String of Problems
  • Index(es):
    • Date
    • Thread