Toolbar problems
Toolbar problems
- Subject: Toolbar problems
- From: Yuhui <email@hidden>
- Date: Wed, 9 Apr 2003 18:21:23 -0500
Hi,
While designing my main window's toolbar using the tutorial at
MacDevCenter
(
http://www.macdevcenter.com/pub/a/mac/2002/03/15/cocoa.html), I've
encountered two problems.
1. Toolbar doesn't seem to recognize Localizable.strings:
For each toolbar item, I set its label to "NSLocalizable(@"the item's
label", @"")" and its tooltip to "NSLocalizable(@"the item's tooltip",
@"")". But when I compiled and ran my program, the toolbar didn't get
its values from Localizable.strings. To ensure that I wasn't seeing
things, I changed one item's label to "Wacky" and another to "Fubar"
and both didn't show up. In fact, the toolbar item used the first part
of the NSLocalizable() function (e.g. "the item's label", "the item's
tooltip") as its label and tooltip respectively.
I'm not using a dictionary for my toolbar, but after encountering this
problem, I'm seriously thinking of switching over. But before I do, I
want to know if I've encountered a known bug or not.
2. Toolbar can't access methods in objects that aren't linked to the
toolbar's window/object.
E.g. my toolbar is in mainWindow. But I have a method in externalObject
that I want to set a toolbar item to use as its action. I tried
[toolbarItem setTarget:[ExternalObject class]];
[toolbarItem setAction:@selector(methodToRun)];
(which I assume means toolbarItem's action is [externalObject
methodToRun])
but the toolbar item remains greyed out (disabled) in my toolbar.
My current workaround is to create an outlet in IB from mainWindow that
connects to externalObject, but I think that it's a waste of resources
because only this particular toolbar item out of all of mainWindow's
outlets requires externalObject. For the same reason (waste of
resources), I didn't initialize externalObject in mainWindow. Is there
a better workaround?
Thanks for your help.
Yuhui
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.