Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NEWBIE: Connecting up all those Ms, Vs and Cs



Hello All...

I'm a newbie to Cocoa (but not the Mac =) and I making my way through the Aaron Hillegass's book and I've reached a point (Ch 15) where I'm stumbling. I really want to use MVC separation at a file level, but setting up the linkages between them is turning out to be a bit of a problem for me.

Quick summary of the problem, write a document-based Cocoa app that allows the user to draw ovals. Add Save/Load and Undo (if you're feeling ambitious =). I'm (perhaps) cheating a bit and combining by MC into a subclass of MyDocument. Up til this point examples/exercises linkages were Target/Action and that clicks with me, but now I have an mouseUp event that needs to create an "oval" in the Model/Controller and that's not clicking. I thought I had it with an IBOutlet in a the StretchView (subclass of NSView) linked back to "My Document" in IB, but when I started to implement the Save functionality I found that object that MyDocument was saving was different than the one StretchView was drawing from.

How should the View be linking up with the Controller? In a perfect Cocoa App how would you setup linkages between M, V, and C?

tia
-S



Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.