How to organize an app (baffled with Accessor methods)
How to organize an app (baffled with Accessor methods)
- Subject: How to organize an app (baffled with Accessor methods)
- From: Jason Galarneau <email@hidden>
- Date: Thu, 3 Oct 2002 13:36:25 +0930
I realize this is probably a trivial question, but I am wondering what
the best (i.e. proper) way to organize an app would be. For example,
imagine a simple app. It consists of a window, 2 buttons (labeled
'next' & 'prev'), and a custom view. When you start the app, the custom
view draws a '0'. Click 'next' and it draws a '1'... that's all it does.
OK, so, I have my custom view class and I have my controller for the
window/buttons. What I'm stumped with is how to have a separate class
for my data. In the app I'm trying to build, I want to draw a calendar
and have the data for each calendar held in an array, and thus be
accessible by both the window controller (i.e. the buttons), and the
custom view controller (so it knows what to draw). My aim is to have
the calendar code in it's own controller/class to make things nice and
tidy.
I'm sure I could use a global array, but I keep hearing that I should
use accessors. I've bought all the cocoa books, and am a bit stumped as
of yet as to how to get this to work.
If you can imagine what I'm trying to do, I would be most grateful for
any advice or sample code.
_______________________________________________
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.