Instance Method

exportObjectToURL:previewImage:error:

Writes a binary representation of the object to the specified file URL.

Declaration

- (BOOL)exportObjectToURL:(NSURL *)url previewImage:(UIImage *)previewImage error:(NSError * _Nullable *)error;

Parameters

url

The file URL at which to write the reference object data.

previewImage

A thumbnail image to be embedded in the reference object's filesystem representation.

ARKit ignores preview images when loading reference objects. Instead, this image helps make reference object files visually identifiable in external tools like Xcode, Finder, and Quick Look.

error

A pointer to an NSError. On completion, if the method returns NO, the pointer is populated with an object describing the failure.

Return Value

YES if the operation succeeded. If NO, check the error parameter for failure details.

Discussion

After exporting a reference object from your object-scanning app to a file, you can bundle that reference object into other apps you create by inserting it into an Xcode asset catalog.

See Also

Saving Recorded Objects

ARReferenceObjectArchiveExtension

The standard filename extension for exported ARReferenceObject instances.