• 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
How to organize an app (baffled with Accessor methods)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: How to organize an app (baffled with Accessor methods)
      • From: Jay Prince <email@hidden>
  • Prev by Date: synching RTFD data
  • Next by Date: menu ext and deamons
  • Previous by thread: synching RTFD data
  • Next by thread: Re: How to organize an app (baffled with Accessor methods)
  • Index(es):
    • Date
    • Thread