macOS/iOS API解説

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

目次

imageDidNotDraw:inRect:

何かの理由で画像が読み込めなかったときに呼び出されます
-(NSImage *)imageDidNotDraw:(id)sender:
     inRect:(NSRect)aRect:

解説

何かの理由で画像が読み込めなかったときに呼び出されます。
デリゲートで実装します。

返り値

( NSImage * )

画像

引数

( id )sender

送信オブジェクト

( NSRect )aRect

範囲

フレームワーク

ApplicationKit

クラス

NSImage

Instance Methods

使用可能

10.0

参照

例文

#import "MyImage.h"

@implementation MyImage
- (NSImage *)imageDidNotDraw:(id)sender inRect:(NSRect)aRect
{
NSImage *img = [NSImage imageNamed: @"NSApplicationIcon" ];//読み込めなかったときの代替画像
NSLog(@"imageDidNotDraw");

return img;
}
@end