Re: Basic Concepts
Re: Basic Concepts
- Subject: Re: Basic Concepts
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 14 Jul 2004 23:10:42 +0200
On mercredi, juillet 14, 2004, at 09:41 PM, Albion Baucom wrote:
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
[...]
You need to create a subclass of NSDocument and set this class to be
the one of the file's owner of the Nib.
Then you can add an outlet ivar to your subclass and make it point to
the view from the file's owner (which is an instance of this class
then).
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?
why not use the NSDocument subclass to do the communication management?
What I am not clear about is when I would need to subclass the
NSDocumentController.
Don't have any idea. I wrote a multi-document cocoa application and
never had too.
_______________________________________________
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.