macOS/iOS API解説

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

目次

setMarkedTextAttributes:

マークテキストの属性をセットします
-(void)setMarkedTextAttributes:(NSDictionary *)attributes:

解説

マークテキストの属性をセットします。サポートする属性は描画色、背景色、アンダーラインです。

返り値

( void )

なし

引数

( NSDictionary * )attributes

文字属性

フレームワーク

ApplicationKit

クラス

NSTextView

Instance Methods

使用可能

10.0

参照

- markedTextAttributes
- markedRange (NSTextInput)

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSDictionary *dic1 = 
[NSDictionary dictionaryWithObjectsAndKeys:
 [NSColor brownColor],@"NSBackgroundColor",
nil];

NSDictionary *dic;
[myOutlet setMarkedTextAttributes:dic1];

dic = [myOutlet markedTextAttributes];

NSLog([dic description]);


}

@end