Re: Re: Odd problem using NSCoding
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