• 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: [IB] Cells vs Controls in the Library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IB] Cells vs Controls in the Library


  • Subject: Re: [IB] Cells vs Controls in the Library
  • From: Stéphane Sudre <email@hidden>
  • Date: Tue, 24 Aug 2010 11:21:08 +0200


On Aug 23, 2010, at 8:41 PM, Christiaan Hofman wrote:


On Aug 23, 2010, at 15:35, Stéphane Sudre wrote:

Stupid question:

Why is there both cell and control instances of the "same" objects in the Library window of Interface Builder?


For instance, you have a Check Box cell and a Check Box control.


Uhm, those are not the same objects, they are different objects. One is a cell (NSButtonCell), the other is a control (NSButton). If you don't understand what the difference between a cell and a control is, you really need to read the basic Cocoa docs (in particular the "cell and control programming topics for cocoa.")

You mean cells are not where you keep inmates?

Wouldn't it be better to just have a Check Box object and have IB figuring out which class will be really used depending on the target of the drop (*)?


Why?

To remove some clutter from the Library so that you can find the object you're looking for faster.


It would also complicate IB a lot, as the objects then would not know what to accept.

As a matter of fact, they or actually the appropriate layout controller already know what they can accept or not. Just try to drop a NSTableView on a NSButton.


It is generally a very bad idea for generic operations (like dropping an objects) to require knowledge about specific peculiarities (like this thing about controls and cells.)

Last time I checked, it was possible to add multiple representations of an object in the pasteboard for a drag operations. So would there be something really bad about having for instance both the cell and the control representations in the pasteboard and then let the layout controller decide which one should be used?


Moreover, the drop target could in fact accept both controls and cells, and you'd be screwed, for instance when you want it to be a top level object (which is really not such a weird thing.)

I would be interested by a good example. For instance, AFAIK, you would need to use a custom view said to be a NSImageView to have a NSImageView accepts a NSButton as a subview in IB.



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: [IB] Cells vs Controls in the Library
      • From: Christiaan Hofman <email@hidden>
References: 
 >[IB] Cells vs Controls in the Library (From: Stéphane Sudre <email@hidden>)
 >Re: [IB] Cells vs Controls in the Library (From: Christiaan Hofman <email@hidden>)

  • Prev by Date: Re: How do you add files that Xcode won't let you navigate to?
  • Next by Date: Creating mixed target iOS and Mac project
  • Previous by thread: Re: [IB] Cells vs Controls in the Library
  • Next by thread: Re: [IB] Cells vs Controls in the Library
  • Index(es):
    • Date
    • Thread