• 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: Copying an NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying an NSView?


  • Subject: Re: Copying an NSView?
  • From: Ondra Cada <email@hidden>
  • Date: Sat, 26 Jan 2002 01:01:38 +0100

tomdale,

>>>>>> email@hidden (t) wrote at Fri, 25 Jan 2002 15:49:05 -0800:
t> What I want to do is
t> create a new instance of my custom NSView and set that copy to the view
t> of the newly created NSTabViewItem. The problem is that NSView doesn't
t> conform to NSCopying, so I'm at a bit of a loss as to what to do.

Well, this should be in FAQ, I guess -- particularly since for a newbie the
correct answer is not intuitive the slightlest bit.

Well, it's surprisingly simple: store the view(s) you need into a NIB, and
load this NIB whenever you want a copy of the view. That's all, with a BIG
added benefit of you being able to set up those views in InterfaceBuilder
instead of the programmatical legwork.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc


  • Follow-Ups:
    • Re: Copying an NSView?
      • From: Tom Dale <email@hidden>
References: 
 >Copying an NSView? (From: email@hidden)

  • Prev by Date: Re: How viable is Cocoa development?
  • Next by Date: Re: 'small' attribute of NSPopUpButton
  • Previous by thread: Copying an NSView?
  • Next by thread: Re: Copying an NSView?
  • Index(es):
    • Date
    • Thread