• 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: IB inspector won't load [Really Solved] (Accessorizer updated)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >IB inspector won't load [Really Solved] (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Hex Conversion to bytes....
  • Next by Date: Re: Controls in NSBrowser
  • Previous by thread: IB inspector won't load [Really Solved]
  • Next by thread: Void values accepted as values in GCC (was Re: IB inspector won't load [Really Solved])
  • Index(es):
    • Date
    • Thread