• 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
Application failing on copyWithZone:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Application failing on copyWithZone:


  • Subject: Application failing on copyWithZone:
  • From: Kevin Hoctor <email@hidden>
  • Date: Sun, 18 Jun 2006 17:07:28 -0500

I had a working application until I tried to take the NSCoding process to the next level. It worked fine when my application simply coded and decoded an NSMutableArray (called accounts) as a member of my DQDocument class, but now it fails with this error:

2006-06-18 11:46:59.799 Debt Quencher[13979] *** -[AccountDocument copyWithZone:]: selector not recognized [self = 0x33e7c0]

The change I made was to add a higher level class called AccountDocument:

@implementation AccountDocument

- (id)initWithCoder:(NSCoder *)coder
{
[super init];
[self setCurrentMethodInUse:[coder decodeIntForKey:@"currentMethodInUse"]];
[self setAccounts:[coder decodeObjectForKey:@"accounts"]];
[self setPrintInfo:[coder decodeObjectForKey:@"printInfo"]];
return self;
}


- (void)encodeWithCoder:(NSCoder *)coder
{
	[coder encodeInt:currentMethodInUse forKey:@"currentMethodInUse"];
	[coder encodeObject:accounts forKey:@"accounts"];
	[coder encodeObject:printInfo forKey:@"printInfo"];
}

I used to just have accounts in my NSDocument subclass and I replaced it with accountDocument. Now I get the above error when I try to open a new document. I'm concerned that I'm chasing a ghost and this has nothing to do with the NSCoding but rather something in my nib. I have an NSArrayController managing accounts.

@implementation DQDocument
- (NSMutableArray *)accounts
{
	return [[self accountDocument] accounts];
}

- (void)setAccounts:(NSMutableArray *)array
{
	[self setAccounts:array];
}
@end

Anything here that helps pinpoint my mistake? I've read (and reread) all the guides and documentation and my Cocoa books but I'm stumped.

Thanks,

Kevin Hoctor

_______________________________________________
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: Application failing on copyWithZone:
      • From: Andrew Merenbach <email@hidden>
  • Prev by Date: saveDocument newbie question
  • Next by Date: Re: saveDocument newbie question
  • Previous by thread: trying again: why do accessors stop "add" from initializing bound value?
  • Next by thread: Re: Application failing on copyWithZone:
  • Index(es):
    • Date
    • Thread