• 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
Re: Re: Odd problem using NSCoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Odd problem using NSCoding


  • Subject: Re: Re: Odd problem using NSCoding
  • From: <email@hidden>
  • Date: Wed, 6 Apr 2005 11:48:21 +0000

TradeModel is a subclass of NSObject, which doesn't conform to NSCoding, so I don't need to call super's initWithCoder.  And in TradeModel.h, I do have:

@interface TradeModel : NSObject <NSCoding>

The problems seems to be in initWithCoder when I call [super init].  I can save just fine with encodeWithCoder.  Per your instructions, initWithCoder now starts like:

- (id)initWithCoder:(NSCoder*)coder
{
   if (self = [super init]) { // calling NSObject's init:
   // ...
}

I set a breakpoing on this method, and as soon as the debugger tries to hit this method, I get the same error about copyWithZone.  I've never encountered this before, and like I said, I have another app that works exactly the same and I don't get any errors.

Do I need to override copyWithZone?  If so, how do you suggest I do this?  I'll be hitting Cocoabuilder.com and searching the archives as well, but I thought I'd ask since I have you here.  :)  Thanks again, Rick.  Oh, and I switched everything over to encode/decodWithObject/int: forKey: as well.  Thanks for the tip.

James

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Re: Odd problem using NSCoding
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Isolating a bug?
  • Next by Date: Re: Tracking text attribute ranges in NSTextStorage
  • Previous by thread: Re: Odd problem using NSCoding
  • Next by thread: Re: Re: Odd problem using NSCoding
  • Index(es):
    • Date
    • Thread