setAttributedStringValue:
属性付文字列をセットします
-(void)setAttributedStringValue:(NSAttributedString *)attribStr:
解説
属性付文字列をセットします。
返り値
( void )
なし
引数
( NSAttributedString * )attribStr
属性付文字列
フレームワーク
ApplicationKit
クラス
NSCell
Instance Methods
使用可能
10.0
参照
- attributedStringValue
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //属性付き文字列作成 NSAttributedString *attStr = [[[NSMutableAttributedString alloc] initWithString:@"Bold Title" attributes:[self systemBoldFontAttributes]] autorelease]; //セット [bCell1 setAttributedStringValue:attStr]; } //太字のシステムフォント属性を返す。 - (NSDictionary*)systemBoldFontAttributes { return [NSDictionary dictionaryWithObject: [NSFont boldSystemFontOfSize:[NSFont systemFontSize]] forKey:NSFontAttributeName]; } @end