Objective-C - Ändern Sie alle Attribute in NSAttributedString?

[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;

     }];

Ich versuche eine Schleife durch alle zugeschrieben, und fügen Sie NSUnderline zu Ihnen. beim Debuggen, wie es scheint, NSUnderline wird dem Wörterbuch Hinzugefügt, aber wenn ich die Schleife für das zweite mal werden Sie entfernt.
Mache ich etwas falsch bei der Aktualisierung NSDictionaries?

InformationsquelleAutor aryaxt | 2011-07-21

Schreibe einen Kommentar