macOS/iOS API解説

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

目次

initWithName:fromFile:

ファイルからカラーリストを作って初期化して返します
-(id)initWithName:(NSString *)name:
             fromFile:(NSString *)path:

解説

ファイルからカラーリストを作って初期化して返します。

返り値

( id )

カラーリスト

引数

( NSString * )name

名前

( NSString * )path

ファイルパス

フレームワーク

ApplicationKit

クラス

NSColorList

Instance Methods

使用可能

10.0

参照

例文

#import "scriptSend.h"

@implementation scriptSend

- (IBAction)myAction:(id)sender
{
NSColorList *cList = [[NSColorList alloc] initWithName:@"NewList"];
NSColorList *cList2;

if ([cList writeToFile:[@"~/NewList.clr" stringByExpandingTildeInPath]])
{
    NSLog(@"YES");
    cList2 = [[NSColorList alloc] initWithName:@"NewList2" fromFile:[@"~/NewList.clr" stringByExpandingTildeInPath]];
}else{
NSLog(@"NO");
}
}

@end