Re: beginner's question: having problems with saving/loading
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