Instance Method インスタンスメソッド

commitEditingAndReturnError:

Attempt to commit pending edits, returning an error in the case of failure.

Declaration 宣言

- (BOOL)commitEditingAndReturnError:(NSError * _Nullable *)error;

Parameters パラメータ

error

If an error occurs during the commit operation, upon returns contains an NSError object that describes the problem.

Return Value 戻り値

YES if the commit is successful, otherwise NO.

Discussion 解説

During autosaving, commit editing may fail, due to a pending edit. Rather than interrupt the user with an unexpected alert, this method provides the caller with the option to either present the error or fail silently, leaving the pending edit in place and the user's editing uninterrupted. In your implementation of this method, you should attempt to commit editing, but if there is a failure return NO and in error an error object to be presented or ignored as appropriate.

See Also 参照

Managing Editing