Basic Concepts
Basic Concepts
- Subject: Basic Concepts
- From: Albion Baucom <email@hidden>
- Date: Wed, 14 Jul 2004 12:41:40 -0700 (PDT)
I am new to Mac programming, and UI design and implementation, but not to
programming in general (most of my programming has been commandline UNIX
based C++, Perl and C-shell).
I have a few basic questions that I am finding hard to answer using the
developer examples and the two books I have (Cocoa in a Nutshell, and
Learning Cocoa with Objective-C). I find the examples too involved (at
least the document based ones) and the books too vague.
I am working in a document based project.
1. When a custom view is instantiated by a NIB, how do you communicate
with it at the function call level from a NSDocument subclass? I don't
understand how you get a handle on the instantiated object when it is
created by the NIB. I see outlets being used, but primarily by other
components (such as sliders and buttons) inside the NIB and those
connections are made in the Interface Builder by control dragging.
I simply want to call a function in a custom view from the NSDocument, but
don't understand how I get a reference to the instantiated object when it
is all encapsulated by the NIB.
My need, in more detail, is to send a filename to a customview prior to it
being displayed in a window so it can read the file, and initialize itself
with that data. I am currently attempting to do that by using the
NSDocument -loadDataRepresentation method. At that point I have a filename
that I need to pass to the custom view to something like -readInputFile.
How do I get reference to the custom view in the NSDocument subclass??
2. I have done some amount of object oriented programming and understand
to some extent orthogonal code design. With this in mind, I am interested
in pulling on the collective wisdom of the list on the class heirarchy of
a simple document based application.
So the application will visualize 3D chemical information (molecular
structure). It will open files that will contain this information and
display it in a single window. There will be preferences for changing
display attributes (color, rendering style, etc). The user will be able to
open more than one document at a time. There will be no need to save the
documents, but I would like to store the preferences for a future session.
From what I currently understand I would just need a NSDocument subclass
to manage each window, a controller class that would manage communication
between the document and interface, a preferences class, and a custom
view. Does this sound reasonable?
What I am not clear about is when I would need to subclass the
NSDocumentController.
Thanks for any and all suggestions!
Albion
Albion E. Baucom
http://rna.ucsc.edu/albion
_______________________________________________
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.