macOS/iOS API解説

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

目次

setAlternateImage:

ハイライト画像をセットします
-(void)setAlternateImage:(NSImage *)newAltImage:

解説

ハイライト画像をセットします。newAltImageがnilなら画像を削除します。

返り値

( void )

なし

引数

( NSImage * )newAltImage

セットする画像

フレームワーク

ApplicationKit

クラス

NSBrowserCell

Instance Methods

使用可能

10.0

参照

- alternateImage

例文

#import "butAction.h"

@implementation butAction

- (IBAction)myAction:(id)sender
{
NSImage *img = [NSImage alloc];
NSImage *altimg = [NSImage imageNamed: @"NSApplicationIcon" ];

[[myOutlet selectedCell] setAlternateImage:altimg];
img = [[myOutlet selectedCell]  alternateImage];

[image setImage:img];
NSLog([[myOutlet selectedCell] className]);
NSLog(@"!!!");
                }

@end