• 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: outlets to multiple views (NSView)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: outlets to multiple views (NSView)


  • Subject: Re: outlets to multiple views (NSView)
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 25 Oct 2006 10:22:30 +0200

Am 25.10.2006 um 08:23 schrieb Aaron Boothello:
When i started programming in Cocoa, i started using the MVC paradigm. My application is mostly openGL based within the Cocoa API. When i first started it was recommended that combining the view&controller. What do you guys reckon ? i dont have any problem splitting them apart....would it be beneficial ? cause the OpenGL views do have to interact with the UI.

Well, it isn't really MVC if you combine view and controller. There are some cases where you may want to split up the controller into a view-controller and a model-controller, but marging the controller into the view or the model destroys most of the advantages of MVC.


Now, keep in mind, in general it's OK to call setNeedsDisplay: directly on you view, and to have the view tell your controller *directly* what it wants, but if you have several views accessing the same model, through the same controller, that no longer is a good idea.

 It's just a matter of using the right tool for the right job.

One thing that helps me often, is to think what parts I would have to replace if I wanted to change my file format (e.g. from XML to SQL or whatever). Most of those parts would be what belongs in the model. OTOH if I wanted to turn this thing into a command-line tool, the parts I'd have to replace would be the "View" part of MVC.

 Does that help?

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ 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
  • Follow-Ups:
    • Re: outlets to multiple views (NSView)
      • From: Aaron Boothello <email@hidden>
References: 
 >outlets to multiple views (NSView) (From: Aaron Boothello <email@hidden>)
 >Re: outlets to multiple views (NSView) (From: Uli Kusterer <email@hidden>)
 >Re: outlets to multiple views (NSView) (From: Aaron Boothello <email@hidden>)

  • Prev by Date: Re: Move file with admin priviledges
  • Next by Date: Re: Cocoa from carbon - cursor tracking issues
  • Previous by thread: Re: outlets to multiple views (NSView)
  • Next by thread: Re: outlets to multiple views (NSView)
  • Index(es):
    • Date
    • Thread