2016-11-11 8 views

答えて

2

これは何について:

NSMutableAttributedString *yourString; //Initialize these things before calling the method below 
NSRange range; 
if ([yourString attribute:NSStrikethroughStyleAttributeName atIndex:text.length - 1 effectiveRange:&range]) { 
    //doSomeStuff 
} 

ドキュメントは、それが返すと言い、「そのような属性が存在しない場合はインデックスの文字のattributeNameの名前の属性の値、またはnilを。」。メソッドが何も返さないかどうかを調べるだけです。

出典:https://developer.apple.com/reference/foundation/nsattributedstring/1408174-attribute?language=objc

関連する問題