• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Changing NSDocument's default saving behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Changing NSDocument's default saving behavior (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Changing NSDocument's default saving behavior
  • Next by Date: Re: completely and utterly confused with NSImage + MySQL
  • Previous by thread: Changing NSDocument's default saving behavior
  • Next by thread: Re: Changing NSDocument's default saving behavior
  • Index(es):
    • Date
    • Thread