A couple of newbie questions (Obj-C)
A couple of newbie questions (Obj-C)
- Subject: A couple of newbie questions (Obj-C)
- From: "Simon Stapleton" <email@hidden>
- Date: Tue, 29 May 2001 10:43:24 +0100
Hi.
I'm developing an app under MacOS X, and I'm having a couple of basic
problems - they're probably covered in the documentation or examples, but
I can't seem to find specific cases. So here goes. Feel free to flame
or answer, at your own discretion.
My App is basically a funky graphical XML editor for a specific type of
markup related to powerkite design. As such, there is a need for a
number of windows to edit curves in a generic sense, but specialised for
the different sections of the file.
I've got an NSDocument subclass containing my model instances (the model
classes deal with all of the 'business logic') and a number of
NSWindowController subclasses, one for each window. These deal with the
specific display logic, and not much else.
The first problem I have is how to pop up specific editor windows from
the main window - The main app window has some basic details and 8
buttons to pop up / unhide the specific editor windows. The window
controller for the main window, of course, knows nothing about the other
windows. So. I suspect I have to have an action method in my main
window controller which does a [[self document] popUpMyWindow] sort of
thing, and let the document worry about it? Is this the case, or is
there a better way of doing it (I suspect there must be, as the Document
shouldn't have to care about it's controllers, surely?)
The next problem is to do with the model classes themselves. For the
most part, they store their underlying data in instnces of
NSMutableDictionary. However, for many of the classes it would make more
sense for the class to actually _be_ an NSMutableDictionary (for one
thing it would make for much less
[[[[self document] kite] planform] area];
type hideousness (That looks like LISP ;-) However, if I do this,
everything compiles clean but I get runtime errors when trying to do a
setObject:forKey: (The specific problem it complains about is that the
method is only defined for an abstract class). Any ideas? Am I being
stupid?
Simon
--
Your mouse has moved. You must reboot Windows NT for these changes to be
recognised.
This message was sent by Easymail -
http://www.easynet.co.uk/