On Oct 1, 2009, at 4:01 PM, Bryan Matteson wrote:

I couldn't find it anywhere in the documentation. But the thing is, it doesn't seem like you can even move a toolbar from one window to another, even properly making sure that it never belongs to more than one at a time, without getting weird drawing errors. I didn't dig too much into that, it's enough to know that it doesn't work. But creating a new one each time DOES work and creates very little additional overhead, as far as I can tell.


Toolbars have always been "special". It seems a lot of "funky things" happen when a window is sent -setToolbar: (even with the shiny new IB 3 toolbar editing support).

It's best to stick to the "Window <-----> Toolbar" approach (as an immutable relationship, once set).

In the grand scheme of things, toolbar creation probably isn't something to worry about. Unless you suspect performance really is causing problems, don't worry about optimizing. If you suspect performance *is* causing a problem, measure it first (with Instruments, for example), then decide on the best course of action. I'm betting it's barely a blip on the radar, compared with any other stuff you might be doing while "switching" windows.

--
I.S.




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to