Tuesday, 30 April 2013

What is NSAttributedString ?

NSAttributedString is like a  NSString, expet every single character has dictionary of attributes. These attributes are things Like font, colour, underline, and etc.


How to get the attributes:
You can ask an NSAttributedString all about the attributes at a given location in the string.
- (NSDictinary  *)attributesAtIndex : (NSUInteger) index
                                   effectiveRange : (NSRangePointer) range;


Remember NSAttributedString is not an NSString, it does not inherits from NSString. So, you can not use NSString methods on it. However if you need to use NSString method, you must first turn NSAttributedString to NSString then use the method.
written by: infinitywebseo  

No comments:

Post a Comment