i've started making new game. game has 3 classes far:
- app delegate, doesn't much.
- view, responsible drawing in game , receiving touch events.
- controller, responsible processing touch events , determining needs drawn.
first question: responsibilities distributed between 2 objects right now?
second question: how should view , controller communicate each other? view needs able pass touch events controller, while controller needs pass needs drawn view. suggestions?
edit:
after spending better part of sunday, appear have found answer second question.
controllers allowed communicate directly views. views should use target/action communicate controllers. or delegation.
artofwarfare - had similar question, kind of. after making few apps myself started ask myself if doing them correctly mvc design. first app made os x pretty had 1 class , wrote code in class , using [self somemethod]; send message it. 1 here pointed out , wasn't taking advantage of object oriented programming basically.
when write app create new file viewcontroller. in .m file write code , import data plists pass viewcontroller viewcontroller via plists.
started wondering if grasping mvc design? when creating new viewcontroller class view xib , controller. wondering if should creating class inherits nsobject use model deals data , loading , saving of plists , core data stuff use.
know little different question still dealing mvc design. next semester take iphone class, learn still book or forum.
i'm wondering thoughts on it?
thanks!
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment