O'Reilly logo

Xcode 4 iOS Development by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – implementing file saving and loading

In order to make our application have the capability to Save and Load, follow these steps:

  1. Modify the MyDocument.h header file to include the following piece of highlighted code:
    #import <Cocoa/Cocoa.h>
    @interface MyDocument : NSDocument {
    IBOutlet NSTextView *rtfTextView;
    NSAttributedString *docString;
    }
    @property(retain) NSTextView *rtfTextView;
    @property(retain) NSAttributedString *docString;
    @end
    
  2. The next stage is to implement the various methods in the MyDocument.m implementation file. You will find that we already have the method stubs defined within this file, so we just need to fill these in. The method called windowControllerDidLoadNib is the method which gets run when the user interface ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required