macOS/iOS API解説

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

目次

data1

追加データ1を返します

解説

追加データ1を返します。
NSAppKitDefined、NSApplicationDefined、NSSystemDefined、NSPeriodicのイベントでなければNSInternalInconsistencyExceptionを起こします。

返り値

( int )

整数値

引数

フレームワーク

ApplicationKit

クラス

NSEvent

Instance Methods

使用可能

10.0

参照

- data2
- subtype+ otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:
+ otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:

例文

#import "MyScrollView.h"

@implementation MyScrollView
- (void)mouseDown:(NSEvent *)event
{
NSEvent *ev = [NSEvent otherEventWithType:NSAppKitDefined
                            location:[event locationInWindow]
                            modifierFlags:nil
                            timestamp:nil
                            windowNumber:[event windowNumber]
                            context:[event context]
                            subtype:nil
                            data1:10
                            data2:11
                            ];

[NSApp sendEvent:ev];
NSLog([NSString stringWithFormat:@"%u",[ev data1]]);
}

@end