• 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: dangers in having a view in a toolbaritem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dangers in having a view in a toolbaritem


  • Subject: Re: dangers in having a view in a toolbaritem
  • From: j o a r <email@hidden>
  • Date: Thu, 7 Aug 2003 08:20:40 +0200

On Thursday, August 7, 2003, at 07.40, Francisco Tolmasky wrote:

Ok, we all know that an nsview can't be two places at once. That much said, does this apply to toolbaritem's as well? When you place a view inside a toolbaritem, that same view appears again when you customize the toolbar. I guess this is just a curiosity question, but does no problem arise from this?

Not if you take into account the requrements placed on the view provided. From the documentation of the "setView:" method of NSToolbarItem:

======================================================================== =====
[...] Also, everything recursively contained in view must be archivable if the customization palette is used. For a view item to be archivable, it and all of its contents must conform to the NSCoding protocol. This implementation is not an issue for standard framework components, but you must be careful with subclasses of them.
======================================================================== =====

In other words: They can rely on the fact that they can make copies of the views provided when necessary. They also mention the copy in the docs of the delegate method "toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: ":

======================================================================== =====
[...] Do not assume that the returned item is going to be added as an active item in the toolbar, as it could be that it will be used only in the customization palette. (The customization palette makes a copy of the returned item.) ======================================================================== =====

j o a r
_______________________________________________
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.

References: 
 >dangers in having a view in a toolbaritem (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: dangers in having a view in a toolbaritem
  • Next by Date: Anything bad about allocWithZone: [self zone]?
  • Previous by thread: dangers in having a view in a toolbaritem
  • Next by thread: Anything bad about allocWithZone: [self zone]?
  • Index(es):
    • Date
    • Thread