Re: IB inspector won't load [Really Solved] (Accessorizer updated)
Re: IB inspector won't load [Really Solved] (Accessorizer updated)
- Subject: Re: IB inspector won't load [Really Solved] (Accessorizer updated)
- From: Kevin Callahan <email@hidden>
- Date: Mon, 29 Nov 2004 08:22:45 -0800
On Nov 29, 2004, at 7:16 AM, Ricky Sharp wrote:
Accesorizer's generated code for encodeWithCoder: will currently do
this:
- (void)encodeWithCoder:(NSCoder *)coder
{
if ([super encodeWithCoder:coder]) {
[coder encodeObject:[self myAttribute] forKey:@"MyAttribute"];
}
}
But encodeWithCoder: doesn't have a return value. Thus, none of the
statements in the 'if' are executed. And because the object isn't
encoded properly, when initWithCoder is called, there is nothing to
decode and so everything remains nil or zero.
The fix was to ensure that encodeWithCoder: is as follows:
- (void)encodeWithCoder:(NSCoder *)coder
{
[super encodeWithCoder:coder];
[coder encodeObject:[self myAttribute] forKey:@"MyAttribute"];
}
I've already alerted Kevin about this.
I just posted a fix to Accessorizer.
http://www.kevincallahan.org/software/accessorizer.html
Thanks for pointing this out, Ricky !
Kevin
Please note that I'm not trying to shed any bad light on Accessorizer.
It really is a very useful tool and has already saved me from typing
pages of code. If you are using the Keyed-Archiving code gen, you'll
need to fix up encodeWithCoder:
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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