macOS/iOS API解説

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

目次

objectForKey:

属性キーで、属性オブジェクトを返します
-(id)objectForKey:(NSString *)anAttribute:

解説

属性キーで、属性オブジェクトを返します。

返り値

( id )

オブジェクト

引数

( NSString * )anAttribute

フレームワーク

ApplicationKit

クラス

NSFontDescriptor

Instance Methods

使用可能

10.4

参照

+fontDescriptorWithFontAttributes:
-fontAttributes
-symbolicTraits

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSFontDescriptor *fntDesc;
fntDesc = [NSFontDescriptor fontDescriptorWithName:@"Osaka" size:36] ;

NSLog(@"%@",[[fntDesc objectForKey:@"NSFontSizeAttribute"] description]);
}

@end