initWithPasteboard:
ペーストボードからサウンドオブジェクトを初期化して返します
-(id)initWithPasteboard:(NSPasteboard *)pasteboard:
解説
ペーストボードからサウンドオブジェクトを初期化して返します。
返り値
( id )
サウンド
引数
( NSPasteboard * )pasteboard
ペーストボード
フレームワーク
ApplicationKit
クラス
NSSound
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" //未 @implementation MyObject - (IBAction)myAction:(id)sender { NSSound *mySound = [NSSound soundNamed : @"Basso"]; NSSound *snd ; [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObjects: NSSoundPboardType, nil] owner:self]; [mySound writeToPasteboard:[NSPasteboard generalPasteboard]]; if ([NSSound canInitWithPasteboard:[NSPasteboard generalPasteboard]]){ snd = [[NSSound alloc] initWithPasteboard:[NSPasteboard generalPasteboard]]; [snd play]; NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end