Question

How should I determine which button is pressed (save, Cancel) when the save dialog is dismissed in an NSDocument based application ? The save panel is the default provided by NSDocument when save is selected from menu.

I would like to have the chance to change some vars before - (BOOL)writeToURL:ofType:error: is invoked.

Thanks...

Was it helpful?

Solution

You could set an object as the save panel's delegate and implement the ‑panel:validateURL:error: method. That method is called after the Save button is pressed but before the document is saved.

However, I'd question the need to do this. What sort of variables do you need to change only when the file is saved? What are you trying to accomplish?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top