Instance Method インスタンスメソッド

initWithString:attributes:

Creates an attributed string with the specified string and attributes. 属性付き文字列をこの指定された文字列と属性で作成します。

Declaration 宣言

- (instancetype)initWithString:(NSString *)str 
                    attributes:(NSDictionary<NSAttributedStringKey, id> *)attrs;

Parameters パラメータ

str

The string for the new attributed string. 新しい属性付文字列に対する文字列。

attrs

The attributes for the new attributed string. For a list of attributes that you can include in this dictionary, see NSAttributedStringKey. 新しい属性付文字列に対する属性。あなたがこの辞書に含めることができる属性の一覧として、NSAttributedStringKeyを見てください。

Discussion 議論

Returns an NSAttributedString object initialized with the characters of str and the attributes of attrs. The returned object might be different from the original receiver. NSAttributedStringオブジェクトを返します、strの文字とattrsの属性で初期化されます。返されるオブジェクトは、元のレシーバとは異なるかもしれません。

See Also 参照

Creating an Attributed String 属性付き文字列を作成する