I'm working my way through Aaron Hillegass's book and am completing the challenge for Chapter 18.
I have a Cocoa App that draws ovals onto an Custom View. Undo/Redo is working, with all the code held in a NSView subclass. I'm having trouble getting loading and saving to trigger. I have included the following in my header
and have implemented the following methods
Everything compiles and runs, but Open and Save are always greyed out on the App menu. The connections I have tried in IB don't seem to make a difference, and the methods above never get called.
All the data is held in a NSMutableArray and I'm not using an array controller.
Can anyone help with this, as I'm running out of ideas.
Thanks
I have a Cocoa App that draws ovals onto an Custom View. Undo/Redo is working, with all the code held in a NSView subclass. I'm having trouble getting loading and saving to trigger. I have included the following in my header
Code:
@interface ovalDraw : NSView <NSCoding> {
Code:
- (void)encodeWithCoder:(NSCoder *)coder
- (id)initWithCoder:(NSCoder *)coder
- (NSData *)dataOfType:(NSString *)aType
error:(NSError **)outError
- (BOOL)readFromData:(NSData *)data
ofType:(NSString *)typeName
error:(NSError **)outError
All the data is held in a NSMutableArray and I'm not using an array controller.
Can anyone help with this, as I'm running out of ideas.
Thanks