• 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
A good model header?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A good model header?


  • Subject: A good model header?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Thu, 29 Jul 2004 22:24:05 +0100

Sorry to ask such basic questions. I've started refactoring my code, and this is the code for the "Model" of the MVC design. (This code is just an illustrative example, the real thing is more complex than necessary to show my new design):

@interface Frac : NSObject <NSCoding> {
double vTurn;
double vSquash;
NSDocument* Doc;
}

-(void)Draw : (CGContextRef)Ref;

-(double)Turn;
-(void)setTurn :(double) t;
-(double)Squash;
-(void)setSquash :(double) sq;

I'm wondering if this is a form that works well with the Cocoa framework? Heres the design changes I made:

1) I've made it use NSCoding
2) It has accessor methods in case I ever want to script my app, or if I want to make it undoable.
3) It has a reference to it's document (with which to access NSUndoManager I think?)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: A good model header?
      • From: Chris Hanson <email@hidden>
References: 
 >Re: Simplifying this code? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Simplifying this code? (From: Shawn Erickson <email@hidden>)
 >Re: Simplifying this code? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Simplifying this code? (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: [OT] Premature optimizations (was: Where is NSList?)
  • Next by Date: Re: cocoa newbie
  • Previous by thread: Re: Simplifying this code?
  • Next by thread: Re: A good model header?
  • Index(es):
    • Date
    • Thread