macOS/iOS API解説

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

目次

removeEventHandlerForEventClass:andEventID:

登録されているアップルイベントハンドラをイベントクラスとイベントIDで取り除きます
-(void)removeEventHandlerForEventClass:(AEEventClass)eventclass:
               andEventID:(AEEventID)eventID:

解説

登録されているアップルイベントハンドラをイベントクラスとイベントIDで取り除きます。

返り値

( void )

なし

引数

( AEEventClass )eventclass

イベントクラス

( AEEventID )eventID

イベントID

クラス

NSAppleEventManager

Instance Methods

使用可能

10.0

参照

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
NSAppleEventManager *aeMgr;
aeMgr = [NSAppleEventManager sharedAppleEventManager];

[ aeMgr setEventHandler:self
        andSelector:@selector(handleAppleEvent:withReplyEvent:)
        forEventClass:kASAppleScriptSuite
        andEventID:kASCommentEvent 
        ];
NSLog([aeMgr description]);
[ aeMgr removeEventHandlerForEventClass:kASAppleScriptSuite
                            andEventID:kASCommentEvent];
}

- (void)handleAppleEvent:(NSAppleEventDescriptor *)inEvent
    withReplyEvent: (NSAppleEventDescriptor *)outReplyEvent

{
NSLog(@"!!!");
}

@end