• 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: Can't customize toolbar in category
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't customize toolbar in category


  • Subject: Re: Can't customize toolbar in category
  • From: "Ryan Poling" <email@hidden>
  • Date: Tue, 29 May 2007 10:22:17 -0700

Weird - I finally managed to fix the problem I previously posted about
with the encodeWithCoder problem upon toolbar customization.  It turned
out to have nothing whatsoever to do with the category I'd added - that
was a false lead.

After doing a lot more searching on the Cocoa-Dev list, I came across
someone who was getting a similar encodeWithCoder error to mine, but his
was caused by the menu template for his search menu.  Strange.

<http://lists.apple.com/archives/cocoa-dev/2006/Oct/msg00849.html>

I went into IB and disconnected my searchMenuTemplate from my
NSSearchField and voilá no more error upon customization (the search
field is in a custom NSView which appears in my toolbar).  Weird.  After
some experimenting, I was unable to figure out what aspect of the menu
template was causing this, so I just created a new one from scratch,
added all the menu items to make it the same as the old one, re-hooked
it up, and now it works.  What the heck?!

Anyone know what I'm missing here?  It works now, so I guess it's not a
huge deal, but this is really strange...

Hope this helps someone else out there!

-Ryan


>I'm having a strange problem...  I added a category on my Controller
>class to separate out all the NSToolbar delegate methods but still have
>access to various ivars in the Controller.  Everything works as expected
>except for customizing the toolbar - when I try to customize, I get the
>following error message in the console:
>
>2007-05-26 12:12:01.626 ProgName[5608] *** -[Controller
>encodeWithCoder:]: selector not recognized [self = 0x32f040]
>
>Any ideas on how to fix this?  It's been a while since I've used a
>category for anything, so perhaps I'm forgetting something about the way
>they work.
>
>I have this init method in my category which is called from the
>Controller's awakeFromNib method.
>
>- (void)setupToolbars {
>	// setup and add the toolbars
>	mainToolbar = [[NSToolbar alloc] initWithIdentifier:@"mainToolbar"];
>	[mainToolbar setDelegate:self];
>	[mainToolbar setDisplayMode: NSToolbarDisplayModeIconOnly];
>	[mainToolbar setAllowsUserCustomization:YES];
>	[mainToolbar setAutosavesConfiguration:YES];
>	[mainWindow setToolbar:mainToolbar];
>}
>
>Thanks,
>
>-Ryan


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: RS: What's the difference?
  • Next by Date: Re: observing dealloc [Solved]
  • Previous by thread: Can't customize toolbar in category
  • Next by thread: NSLocalizedStringFromTableInBundle not returning localized string
  • Index(es):
    • Date
    • Thread