• 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
Getting hold of an NSView from an NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting hold of an NSView from an NSDocument


  • Subject: Getting hold of an NSView from an NSDocument
  • From: "Michael P. Rogers" <email@hidden>
  • Date: Sun, 10 Feb 2002 20:29:19 -0600

I created an NSView subclass called EtchASketch that is able to draw itself, accessing an internal NSMutableArray of MyPoint objects (which wrap an x, y, and a label (NSString). It is a self-contained class that works fine.

Now, however, I'm trying to use it in an NSDocument application. So, I create an EtchASketch in the nib file (well, I drag a CustomView and then indicate that it's an EtchASketch). MyDocument has an IBOutlet called etchy, and I use IB to make the connection.

However, that connection doesn't seem to "last". If I close my window, then make a new one, etchy is nil. So, is it correct to say that when I load a new nib file, I'm really loading a whole new set of objects, so the connection I make in IB isn't relevant?

And in this same vein, *can* I load a new MyDocument, and then programatically tell it where the EtchASketch object is?

I'm allegedly lecturing on this in a few hours, so I hope that well-rested Cocoa programmers on the other side of the world will kindly help me out on this :-)

Thanks,

Michael
--
---------------------------------
Dr. Michael Rogers
e-mail: email@hidden
Phone: 217-424-6327

For information about Computer Science at Millikin University, visit http://math.millikin.edu
For information about astronomy, check out http://twincityamateurastronomers.org
_______________________________________________
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.
  • Follow-Ups:
    • Re: Getting hold of an NSView from an NSDocument
      • From: Bob Savage <email@hidden>
  • Prev by Date: Re: about help
  • Next by Date: [slightly OT] rant
  • Previous by thread: Re: Double call of awakeFromNib on custom view
  • Next by thread: Re: Getting hold of an NSView from an NSDocument
  • Index(es):
    • Date
    • Thread