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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to