macOS/iOS API解説

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

目次

setLinkTextAttributes:

リンクテキスト属性をセットします
-(void)setLinkTextAttributes:(NSDictionary *)attributeDictionary:

解説

リンクテキスト属性をセットします。
【リンクテキスト属性】
●NSColor リンクの色
●NSCursor リンクの上でのカーソル
●NSUnderline 下線を引くか 引かない=0 引く=1 IntのNSNumber

返り値

( void )

なし

引数

( NSDictionary * )attributeDictionary

フレームワーク

ApplicationKit

クラス

NSTextView

Instance Methods

使用可能

10.3

参照

-linkTextAttributes

例文

#import "SetImage.h"

@implementation SetImage

- (IBAction)set:(id)sender
{
NSDictionary *dic = 
        [NSDictionary dictionaryWithObjectsAndKeys:
        [NSColor redColor],@"NSColor",
        [NSCursor pointingHandCursor],@"NSCursor",
        [NSNumber numberWithInt:1],@"NSUnderline",
        nil];

[name setLinkTextAttributes:dic];

        NSLog(@"linkTextAttributes %@",[[name linkTextAttributes] description]);


}

@end