• 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
A bit confused about NSView instances in Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A bit confused about NSView instances in Interface Builder


  • Subject: A bit confused about NSView instances in Interface Builder
  • From: Fabio Mancinelli <email@hidden>
  • Date: Sun, 01 Oct 2006 19:41:49 +0200

Hello all.

I was studying an application's source code when I saw in the Instance pane of Interface Builder an icon identified by "View".

I discovered that it is possible to instantiate NSView (sub)classes and when you do so a "View" icon appears in the IB's instances pane.

Anyway I am a bit confused about the usage of those instances.
I'll try to explain.

When I double click a "View" instance a new window opens and I can add to it all the controls I want as I do, for example, with the main window.

I thought that it was a way to "factorize" part of the interface by creating "view components" that could be reused. But I confused because things don't work as I expect and I cannot see what is the logic behind.

For example: I create a subclass of NSView, let's say A. Then I instantiate A and a "View" icon appears in the IB's instances pane.
Double clicking A opens up a window where I add a bunch of control.
Then I go to the main window, I drop a custom view control and I set its custom class to A. I expected that the controls that I put in the A design window would appear but nothing happens.


Moreover if I generate the files for A in the XCode none of the controls I have added is present in the structure of the class.

So the question is: what are view instances useful for and how are they used?

I am sorry if the answer to this question is trivial but I cannot see what it is.

Thank you.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: A bit confused about NSView instances in Interface Builder
      • From: Scott Ribe <email@hidden>
    • Re: A bit confused about NSView instances in Interface Builder
      • From: j o a r <email@hidden>
  • Prev by Date: NSScreen and capturing a second display only
  • Next by Date: Re: NSScreen and capturing a second display only
  • Previous by thread: Re: NSScreen and capturing a second display only
  • Next by thread: Re: A bit confused about NSView instances in Interface Builder
  • Index(es):
    • Date
    • Thread