macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setReceiversSpecifier:

レシーバの指示子をセットします
-(void)setReceiversSpecifier:(NSScriptObjectSpecifier *)receiversSpec:

解説

レシーバの指示子をセットします。

返り値

( void )

なし

引数

( NSScriptObjectSpecifier * )receiversSpec

レシーバの指示子

クラス

NSScriptCommand

Instance Methods

使用可能

10.0

参照

- evaluatedReceivers
- receiversSpecifier

例文

// Apple Scriptコマンド
-(NSNumber *) retCommand:(NSScriptCommand *)sCommand
{
//スクリプト記述用の辞書
NSDictionary *dicSource = 
    [NSDictionary dictionaryWithObjectsAndKeys:
    @"Myou",@"AppleEventCode",
    @"NO",@"ReadOnly",
    @"NSNumber<Int>",@"Type",nil];
NSDictionary *dicSupportedCommands = 
    [NSDictionary dictionaryWithObjectsAndKeys:
    @"retCommand",@"test.ScriptControll",
    nil];
NSDictionary *dicMyObject = 
    [NSDictionary dictionaryWithObjectsAndKeys:
    @"MyOb",@"AppleEventCode",
    dicSource,@"Attributes",
    [NSNull class],@"InverseRelationships",
    @"NSCoreSuite.AbstractObject",@"Superclass",
    dicSupportedCommands,@"SupportedCommands",
    [NSNull class],@"ToManyRelationships",
    @"",@"ToOneRelationships",
    nil];
NSScriptClassDescription *scDesc = [[NSScriptClassDescription alloc] initWithSuiteName:@"test" className:@"MyObject" dictionary:dicMyObject];
//indexSpecifierを作る
NSIndexSpecifier *indexSpecifier = [[[NSIndexSpecifier allocWithZone:[self zone]] initWithContainerClassDescription:scDesc containerSpecifier:nil key:@"orderedDocuments" index:1] autorelease];

NSNumber * number = (NSNumber *)[[sCommand arguments] 
                                                objectForKey:@"withNumber"];
                                                
[sCommand setReceiversSpecifier:indexSpecifier];                                    
NSLog([[sCommand directParameter] className]);
		return number;
	}