• 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: [IBPalette] inspectorClassName returns (null)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IBPalette] inspectorClassName returns (null)


  • Subject: Re: [IBPalette] inspectorClassName returns (null)
  • From: Claudio Procida <email@hidden>
  • Date: Sun, 24 Sep 2006 14:03:33 +0200

On Sep 23, 2006, at 14:19, Ricky A. Sharp wrote:

This can happen if an exception is being thrown in your inspector's revert: method.

Have you looked in the Console for messages? You may want to add logging to your inspector's methods to help track down where things are going wrong.

Something to look into is if your inspector's revert: method can properly handle nil values coming from your object. When adding new pointer-based attributes to your object, older archived objects will return nil values for the new attribute's key.

To prevent this, you can do things like...

-(void)revert:(id)sender
{
    NSColor* theColor = [[self object] someColorAttribute];

if (theColor == nil)
theColor = [NSColor blackColor]; // or whatever default makes sense

    [someColorWell setColor:theColor];

    ...
}

I guess you've found the reason without any code (my fault not reporting it)


the inspector's revert: method is the following:

- (void)revert:(id)sender
{
	ELFlatGradientView *gradientView = [self object];
	[lightColorWell setColor:[gradientView lightColor]];
	[darkColorWell setColor:[gradientView darkColor]];
	[super revert:sender];
}

And I naively didn't check for nil return values :P
Thanks!

Claudio
--
http://www.emeraldion.it
_______________________________________________
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


  • Prev by Date: Re: Guidelines for disabling controls
  • Next by Date: Obtain computer model
  • Previous by thread: Re: [IBPalette] inspectorClassName returns (null)
  • Next by thread: Scrolling NSOutlineView makes attributed string bold
  • Index(es):
    • Date
    • Thread