Re: Changing NSDocument's default saving behavior
Re: Changing NSDocument's default saving behavior
- Subject: Re: Changing NSDocument's default saving behavior
- From: Seth Willits <email@hidden>
- Date: Sun, 26 Feb 2006 12:50:21 -0800
On Feb 26, 2006, at 11:40 AM, Stephen F. Booth wrote:
Which methods would I need to override to achieve this? I have
tried everything I can think of; I am able to modify the original
file in place (simply by using [self fileURL] as the path, but the
save operations are reported as failing to the user, since the
temporary file is not being created.
- (BOOL)saveToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName
forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)
outError
{
BOOL result = [self writeToURL:absoluteURL ofType:typeName
forSaveOperation:saveOperation originalContentsURL:absoluteURL
error:outError];
if (result && (saveOperation == NSSaveAsOperation || saveOperation
== NSSaveOperation)) {
[self setFileName:[absoluteURL relativePath]];
[self updateChangeCount:NSChangeCleared];
}
return result;
}
Try that.
--
Seth Willits
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden