Is there an easy way to split NSAttributedString, so I only get the last 50 lines?
No. You will need to query the string and determine the range of interest to you, and then create a new NSAttributedString obtained from the source using the API, for example - [NSAttributedString attributedSubstringFromRange:] :
- (NSAttributedString *)lastFiftyLinesOfAttributedString:(NSAttributedString *)pInput { NSString * string = pInput.string; NSRange rangeOfInterest = ...determine the last 50 lines in "string"...; return [pInput attributedSubstringFromRange:rangeOfInterest]; }
source share