Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (BOOL) writeToURL:(NSURL*)writeURL ofType:(NSString*)type forSaveOperation:(NSSaveOperationType)saveOp originalContentsURL:(NSURL*)origURL error:(NSError**)errorPtr
- {
- return [@"Testing" writeToURL:writeURL atomically:NO encoding:NSUTF8StringEncoding error:errorPtr];
- }
- - (void) saveToURL:(NSURL*)url ofType:(NSString*)fileType forSaveOperation:(NSSaveOperationType)saveOp delegate:(id)del didSaveSelector:(SEL)delSel contextInfo:(void*)delContext
- {
- NSAssert( [url isEqual:[self fileURL]], @"only support saving over the same file" ); // for testing.. make sure URL isn't changing
- NSAssert( nil == del, @"no delegate supported" ); // just for testing.. making sure that Cocoa doesn't expect a callback
- NSAssert( NSSaveOperation == saveOp, @"only regular save supported" ); // also just for testing.. this is all we handle
- NSError* error;
- BOOL isWritten = [self writeSafelyToURL:url ofType:fileType forSaveOperation:saveOp error:&error];
- if( isWritten ) [self updateChangeCount:NSChangeCleared];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement