• 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
MVC roles of objects in pattern
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MVC roles of objects in pattern


  • Subject: MVC roles of objects in pattern
  • From: "ad veloper" <email@hidden>
  • Date: Fri, 5 Oct 2007 15:43:39 +0100

Does the following legitimately conform to the MVC design pattern? It seems
as though the camera object is fulfilling 2 roles: Model and View. Something
doesn't ring true about this kind of design, but I can't see another way of
doing it.

Here goes!

1. My View class has an instance of an object: Camera, which is updated
according to mouse events.

2. I also have an array of these camera objects being managed by an
arrayController in my AppController instance, so that the user may save
camera positions.

3. SelectionIndex changes in the arrayController  causes the view to animate
and update its Camera's iVars to those of the selectedCameraObject in the
array.

Using this method I can decouple the array of Cameras, but still have a
functioning view.

Is this okay, or should I do it differently?

Thanks.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Just-in-time debugging / CrashReporterPrefs
  • Next by Date: Re: Is ZLib available in Cocoa?
  • Previous by thread: Re: Is ZLib available in Cocoa?
  • Next by thread: Re: MVC roles of objects in pattern
  • Index(es):
    • Date
    • Thread