macOS/iOS API解説

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

目次

textColor

最初の文字または挿入位置の文字の描画色を返します

解説

最初の文字または挿入位置の文字の描画色を返します。

返り値

( NSColor * )

文字の色

引数

フレームワーク

ApplicationKit

クラス

NSText

Instance Methods

使用可能

10.0

参照

- setTextColor:
- setTextColor:range:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

[myOutlet setString:@"abcdefghijklmn"];
[myOutlet setTextColor:[NSColor redColor]];

NSLog([[myOutlet textColor] colorSpaceName]);
}

@end