| Home 目次>ApplicationKit>NSImage | 10.2 |
initByReferencingURL:
指定したURLからNSImageを初期化します
-(id) initByReferencingURL:(NSURL *)url
【返り値】 | |
| id | オブジェクト() |
| 【パラメータ】 | |
| url |
【解説】
指定したURLからNSImageを初期化します。
【例文】
#import "SetImage.h"
@implementation SetImage
- ( IBAction )set:( id )sender
{
//Image を作る
NSImage *img;
img = [[NSImage alloc] initByReferencingURL:[NSURL
URLWithString: @"http://www.oomori.com/image/main.gif" ]];
// レシーバ image ( NSImageView )に img をセットする
[image setImage : img ];
}
@end
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSImage | 修正日2006.12.26 |