Instance Method


Throws an error when the value specified by a given pointer is not valid for a given key path relative to the receiver.


func validateValue(_ ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, forKeyPath inKeyPath: String) throws



A pointer to a new value for the property identified by inKeyPath. This method may modify or replace the value in order to make it valid.


The name of one of the receiver's properties. The key path must specify an attribute or a to-one relationship. The key path has the form relationship

.property (with one or more relationships); for example or department.manager.lastName.

Return Value

A Boolean that is true if the value pointed at by ioValue is valid for the property identified by inKeyPath, or if the method is able to modify the value at ioValue to make it valid; otherwise false.


The default implementation of this function gets the destination instance for each relationship using value(forKey:) and then calls the validateValue(_:forKey:) function for the property. The outcome of that call determines whether this one throws an error or not.

See Also


func validateValue(AutoreleasingUnsafeMutablePointer<AnyObject?>, forKey: String)

Throws an error when the value specified by a given pointer is not valid or can't be made valid for the property identified by a given key.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software