macOS/iOS API解説

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

目次

menuForEvent:inRect:ofView:

メニューを表示させるときに呼び出されますサブクラスでオーバーライドします
-(NSMenu *)menuForEvent:(NSEvent *)anEvent:
            inRect:(NSRect)cellFrame:
            ofView:(NSView *)aView:

解説

メニューを表示させるときに呼び出されます。サブクラスでオーバーライドします。

返り値

( NSMenu * )

メニュー

引数

( NSEvent * )anEvent

イベント

( NSRect )cellFrame

範囲

( NSView * )aView

ビュー

フレームワーク

ApplicationKit

クラス

NSCell

Instance Methods

使用可能

10.0

参照

例文

#import "MyButtonCell.h"

@implementation MyButtonCell

-(NSMenu *)menuForEvent:(NSEvent *)anEvent inRect:(NSRect)cellFrame ofView:(NSView *)aView
{
NSLog(@"!!!");
return nil;
}


@end