Getting attribute dictionaries from NSAttributedString

How to get NSAttributedString attributes?

I thought using enumerateAttributesInRange:NSMakeRange(0, str.length)and then storing all the attributes in NSMutableDictionaries, but I would like to know if there is a better way.

EDIT ------ My problem is what I have NSAttributedStringand I want to use this function in my attributes ...

CTFramesetterSuggestFrameSizeWithConstraints(framesetter,range, __ATTRIBUTES__, size , NULL);
+5
source share
2 answers
 NSDictionary *attributesFromString = [string attributesAtIndex:0 longestEffectiveRange:nil inRange:NSMakeRange(0, string.length)];
0
source
UITextView *t = [[UITextView alloc] init];
[t setAttributedText:a];
t.typingAttributtes
-1
source

All Articles