[attributedString enumerateAttributesInRange:range options:NSAttributedStringEnumerationReverse usingBlock:
^(NSDictionary *attributes, NSRange range, BOOL *stop) {
NSMutableDictionary *mutableAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes];
[mutableAttributes setObject:[NSNumber numberWithInt:1] forKey:@"NSUnderline"];
attributes = mutableAttributes;
}];
私はすべての属性をループして、それらに NSUnderline を追加しようとしています。デバッグ時に NSUnderline がディクショナリに追加されているように見えますが、2 回目にループすると削除されます。NSDictionaries の更新中に何か問題がありますか?