widthOfString:
文字の幅を返します
-(float)widthOfString:(NSString *)aString:
解説
文字の幅を返します。
Mac OS X v10.4以降使えません。
返り値
( float )
文字の幅
引数
( NSString * )aString
幅を返す文字
フレームワーク
ApplicationKit
クラス
NSFont
Instance Methods
使用可能
10.0
参照
- mostCompatibleStringEncoding
例文
[font widthOfString:@"x"]; /// [tf setFloatValue:[fnt widthOfString:@"a"]];