- insertValue:atIndex:inPropertyWithKey:
- removeValueAtIndex:fromPropertyWithKey:
- replaceValueAtIndex:inPropertyWithKey:withValue:
- valueAtIndex:inPropertyWithKey:
Technology
Cocoa scripting takes advantage of key-value coding to get and set information in scriptable objects. Cocoaスクリプティングは、「キー値」コーディングを利用して、スクリプト対応オブジェクの中の情報を取得及び設定します。 The methods in this category provide additional capabilities for working with key-value coding, including getting and setting key values by index in multi-value keys and coercing (or converting) a key value. Additional methods allow the implementer of a scriptable container class to provide fast access to elements that are being referenced by name and unique ID.
Because Cocoa scripting invokes set
and mutable
, changes to model objects made by AppleScript scripts are observable using automatic key-value observing.
Note 注意
In OS X 10.3 and earlier, Cocoa scripting did not invoke set
or mutable
, so automatic key-value observing notification was not always done for model object changes caused by scripts. Starting in macOS 10.4, for backward binary compatibility, if it is overridden, Cocoa invokes the now-deprecated method take
instead of set
.
- insertValue:atIndex:inPropertyWithKey:
- removeValueAtIndex:fromPropertyWithKey:
- replaceValueAtIndex:inPropertyWithKey:withValue:
- valueAtIndex:inPropertyWithKey:
- insertValue:inPropertyWithKey:
- valueWithName:inPropertyWithKey:
- valueWithUniqueID:inPropertyWithKey:
- coerceValue:forKey:
NSScriptCoercionHandler
to attempt to convert value
for key
to the proper type, if necessary.NSScriptCoercionHandler
NSScriptExecutionContext