Contents

init(elementCode:properties:data:)

Returns an instance of an SBObject subclass initialized with the specified properties and data and added to the designated element array.

Declaration

init(elementCode code: DescType, properties: [String : Any]?, data: Any?)

Parameters

  • code:

    A four-character code used to identify an element in the target application’s scripting interface. See Apple_event_manager for details.

  • properties:

    A dictionary with Nsnumber keys specifying the four-character codes of properties (that is, attributes or to-one relationships) and the values for those properties. Pass nil if you are initializing the object by data only.

  • data:

    An object containing data for the new SBObject object. The data varies according to the type of scripting object to be created. Pass nil if you initializing the object by properties only.

Return Value

An SBObject object or nil if the object could not be initialized.

Discussion

Unlike the other initializers of this class, this method not only initializes the SBObject object but adds it to a specified element array. This method is the designated initializer.

See Also

Initializing a Scripting Bridge Object