Contents

saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:

Called after the user has been given the opportunity to select a destination through the modal Save panel.

Declaration

- (void) saveToFile:(NSString *) fileName saveOperation:(NSSaveOperationType) saveOperation delegate:(id) delegate didSaveSelector:(SEL) didSaveSelector contextInfo:(void *) contextInfo;

Discussion

Called after the user has been given the opportunity to select a destination through the modal Save panel presented by runModalSavePanel(for:delegate:didSave:contextInfo:). The delegate is assigned to the Save panel. If fileName is non-nil, this method writes the document to fileName, sets the document’s file location and document type (if a native type), and clears the document’s edited status. didSaveSelector gets called with true if the document is saved successfully, and false otherwise. The saveOperation is one of the constants in Constants. Pass contextInfo with the callback.

The didSaveSelector callback method should have the following signature:

- (void)document:(NSDocument *)doc didSave:(BOOL)didSave contextInfo:(void  *)contextInfo

See Also

Methods