• 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 problem with subclass of NSCalendarDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Archiving problem with subclass of NSCalendarDate


  • Subject: Archiving problem with subclass of NSCalendarDate
  • From: email@hidden
  • Date: Wed, 23 Jan 2002 01:50:58 +0900

hello,
I'm trying to make lunar calendar.
So, I made LunarDate class, subclass of NSCalendarDate. and added some instance variables, methods...for lunar.
everything works fine except Archiving and Unarchiving. I tried and tried to solve this problem, but couldn't.
How can I Archive subclass of NSCalendarDate?
this is my sample code for archiving..

@interface LunarDate : NSCalendarDate <NSCoding>{

NSString *str;
BOOL isLeap;
.
.
}
@implementation LunarDate
-(id)initWithCoder:(NSCoder*)coder
{
if(self=[super initWithCoder:coder])
{
[self setStr:[coder decodeObject]];
}
return self;
}

-(void)encodeWithCoder:(NSCoder*)coder
{
[super encodeWithCoder:coder];
[coder encodeObject:str];
}

when I subclass NSObject,(After deleting if(self=....),[super ....]) ,this code works fine..but whenever I subclass NSCalendarDate , and Unarchive it,
*** NSUnarchiver: inconsistency between written and read data for object 0x1433f0 Error occured.
how can I Archive the subclass of NSCalendarDate?..

and..sorry poor my English :-<


  • Prev by Date: app preferences top view
  • Next by Date: Re: Calling BSD from Cocoa and/or CFM?
  • Previous by thread: RE: app preferences top view
  • Next by thread: Re: cocoa-dev digest, Vol 2 #53 - 10 msgs
  • Index(es):
    • Date
    • Thread