Return Value
戻り値
The new object.
新しいオブジェクト。
Returns nil
if an error occurs.
Discussion
解説
You can override the newScriptingObjectOfClass
method to take more control when your application is sent a make
command. This method is invoked on the prospective container of the new object.
このメソッドは、新しいオブジェクトの予想されるコンテナ上で発動されます。
The contentsValue
and properties
are derived from the with contents
and with properties
parameters of the make
command. The returned objects or objects are then inserted into the container using key-value coding.
返されるオブジェクトまたは複数のオブジェクトは、それから「キー値」コーディングを使ってコンテナへと挿入されます。
When this method is invoked by Cocoa, neither the contents value nor the properties will have yet been coerced using the NSScriptKeyValueCoding
method coerceValue(_:forKey:)
. For sdef-declared scriptability, however, the types of the passed-in objects reliably match the relevant sdef declarations.
sdefで宣言されるスクリプト対応機能情報にとっては、しかしながら、渡されたオブジェクトの型は期待通りに関係するsdef宣言部分と一致します。
The default implementation of this method creates new scripting objects by sending alloc
to a class and init
to the resulting object. You override this method for situations where this is not sufficient, such as in Core Data applications, in which new objects must be initialized with [NSManagedObject initWithEntity:insertIntoManagedObjectContext:]
.