• 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: Using an IB-built view multiple times
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using an IB-built view multiple times


  • Subject: Re: Using an IB-built view multiple times
  • From: Michel Schinz <email@hidden>
  • Date: Tue, 20 Sep 2005 18:27:45 +0200

Le 20 sept. 05 à 18:08, Christopher Drum a écrit :

It seems that this is possible if I create the entire template view programatically, then instantiate one anytime I need it. However, I was hoping there was some kind of procedure that would allow me to build the template graphically, then clone out instances of that view as needed. NSView doesn't seem to adhere to <NSCopying> protocol. So, I'm getting myself a little lost here. Is it even possible to subclass NSView to adhere to <NSCopying>?

In Interface Builder, you can drag a "Custom View" object in the "Instances" pane. That will create a view, which will be shown in a window. You can then set its contents in IB, as usual, and save the NIB file. Then, in your code, you simply use the NSNib class to load the file and instantiate it as many times as you want. Voilà...


Michel.


_______________________________________________ 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
References: 
 >Using an IB-built view multiple times (From: Christopher Drum <email@hidden>)

  • Prev by Date: Re: Work with zerolink enabled; crashes due to signal 5 (SIGTRAP) without
  • Next by Date: Database developer needed In Vancouver BC
  • Previous by thread: Using an IB-built view multiple times
  • Next by thread: Re: Using an IB-built view multiple times
  • Index(es):
    • Date
    • Thread