• 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: beginner's question: having problems with saving/loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: beginner's question: having problems with saving/loading


  • Subject: Re: beginner's question: having problems with saving/loading
  • From: mmalc Crawford <email@hidden>
  • Date: Tue, 12 May 2009 13:10:09 -0700


On May 11, 2009, at 12:42 PM, Gabriel Roth wrote:


The app contains just one class (besides MyDocument), called
AppController. The code for AppController is pasted below, followed by
console output.

Apart from issues others have already identified:

You almost certainly shouldn't be encoding/archiving this object.
You're combining a model and a controller object.

Given that you have a document class (which serves as a controller), there shouldn't be any need for an additional AppController class.
If you want to save a string in a document-based application, then implement the relevant NSDocument methods (e.g. dataOfType:error:).


You should review the Document-Based Applications Guide, in particular <http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Concepts/RolesOfDocObjects.html >.
Review also <http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html#//apple_ref/doc/uid/TP40002974-CH6-SW1 >.


mmalc

_______________________________________________

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


  • Follow-Ups:
    • Re: beginner's question: having problems with saving/loading
      • From: Gabriel Roth <email@hidden>
References: 
 >beginner's question: having problems with saving/loading (From: Gabriel Roth <email@hidden>)

  • Prev by Date: Re: beginner's question: having problems with saving/loading
  • Next by Date: How to know CD Driver type
  • Previous by thread: Re: beginner's question: having problems with saving/loading
  • Next by thread: Re: beginner's question: having problems with saving/loading
  • Index(es):
    • Date
    • Thread