views:

48

answers:

1

I think I may be missing the obvious but I'm not sure.

The section on subclassing NSDocument in the docs states that subclasses of NSDocument must override one reading and one writing method.

If I'm creating a viewer application that will not write anything back, do I still need to override a writing method (returning what, nil?) or can I ignore it and make sure that there are no saving methods that can get called?

+1  A: 

Given that the documentation says “must”, I’d say yes, write a do-nothing write method. Even if it works without one now, and there’s no obvious reason to break that, if it says “must” it’s entirely fair for AppKit to actually require it at some point in future.

Ahruman
Thanks for the answer Jens.
Abizern