macOS/iOS API解説

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

目次

setAttributedTitle:

属性付き文字列をタイトルをセットします
-(void)setAttributedTitle:(NSAttributedString*)anAttributedString:

解説

属性付き文字列をタイトルをセットします。

返り値

( void )

なし

引数

( NSAttributedString* )anAttributedString

属性付き文字列

フレームワーク

ApplicationKit

クラス

NSFormCell

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject
- (NSDictionary*)boldFontAttributes {
    return [NSDictionary dictionaryWithObject: [NSFont boldSystemFontOfSize:[NSFont systemFontSize]] forKey:NSFontAttributeName];
}



- (IBAction)myAction:(id)sender
{
[form1 setAttributedTitle: [[NSMutableAttributedString alloc] initWithString:@"newForm:" attributes:[self boldFontAttributes]]];

NSLog([[form1 attributedTitle] string]);

}

@end