Thanks Jerry, it is part of an NSPersistentDocument subclass. I get a bit confused about which save method(s) I would have to implement in my subclass, as there seem to be a number of save... methods and a number of writeTo... methods. The potential candidates seem to be:
saveDocument: saveDocumentWithDelegate:didSaveSelector:contextInfo: saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: saveToURL:ofType:forSaveOperation:error: writeSafelyToURL:ofType:forSaveOperation:error: writeToURL:ofType:forSaveOperation:originalContentsURL:error: writeToURL:ofType:error: From my reading of the documentation, the first place in the chain that you are absolutely sure that the user is going to save, and not back out of a save panel or something would be saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: so I guess it would be fine for me to override that, send my notification, and call super... On 29/07/2010, at 12:36 PM, Jerry Krinock wrote: > > If this is a document's managed object context, there are lots of methods in > NSDocument which you can subclass to post a notification. Otherwise, you > could wrap -[NSManagedObjectContext save:] in your own -save… method in some > other class, say whatever "owns" this managed object context, and use your > new -save… method instead. > _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
