• 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
Re: MVC paradigm: multiple controllers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MVC paradigm: multiple controllers?


  • Subject: Re: MVC paradigm: multiple controllers?
  • From: J Tichenor <email@hidden>
  • Date: Tue, 5 Oct 2004 21:11:19 +0100


Many thanks for your reply. The advice about not
having too many controllers but at the same time not
throwing everything into one controller seems sound,
though a little harder to work out than it sounds!

Notifications seem a good way to go, but I'm still a
little confused about how - or whether - to split up
controllers that deal with the same data. For
instance, like I say, I have a table view that shows
some of the same data as an outline view (much like in
Xcode) - should they both use the same controller? If
not, how can they both access the same data? Surely
the data class has to be instantiated in only one
place? But if they should use the same controller,
then it will get pretty long and unmanageable when all
the delegate methods for the outline view and the
table view are implemented along with all of the
saving and opening of documents etc.


All I am doing, when my mainController notified my other controllers, is sending the chosen object out and letting each controller deal with displaying as they see fit. Remember, you instantiate your data object in one controller and then pass pointers to that instance for the other controllers to work with. At least that's how I'm building and so far so good.

I have as many controllers as I have major views in my app -- one mainController and one each for major tabViews. I will also create a controller for a major information/preferences panel. Again, I am new and learning so don't know if this is right or wrong -- just what works in my brain at the moment.

Is there a good tutorial on controller management
anywhere? Most tutorials and examples in books deal
with simple programs that can happily use one
controller; I would really like to read something
about using and splitting up controllers effecively in
a large program.


No, I haven't found any multi controller tutorials - maybe on macdevcenter...?

J

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Re: MVC paradigm: multiple controllers? (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: FOUND Workaround Re: Disk Utility....
  • Next by Date: [Absolutely Baffled] Drag-and-Drop updating a controller techniques, advice sought...
  • Previous by thread: Re: MVC paradigm: multiple controllers?
  • Next by thread: Re: MVC paradigm: multiple controllers?
  • Index(es):
    • Date
    • Thread