macOS/iOS API解説

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

目次

runOperationModalForWindow:delegate:didRunSelector:contextInfo:

ウインドウを表示して印刷操作を実行します
-(void)runOperationModalForWindow:(NSWindow *)docWindow:
             delegate:(id)delegate:
             didRunSelector:(SEL)didRunSelector:
             contextInfo:(void *)contextInfo:

解説

ウインドウを表示して印刷操作を実行します。

返り値

( void )

なし

引数

( NSWindow * )docWindow

文書ウインドウ

( id )delegate

デリゲート

( SEL )didRunSelector

セレクタ

( void * )contextInfo

追加情報

フレームワーク

ApplicationKit

クラス

NSPrintOperation

Instance Methods

使用可能

10.0

参照

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{

NSPrintOperation *op = [NSPrintOperation printOperationWithView:[[sender window] contentView]];
NSPrintInfo *pInfo = [NSPrintInfo sharedPrintInfo] ;

[op setPrintInfo:pInfo];

[op runOperationModalForWindow:[sender window] 
            delegate:self 
            didRunSelector:@selector(endRun) 
            contextInfo:nil];

}
-(void)endRun
{
NSLog(@"end");
}
@end