Why does the initial call to NSAttributedString with an HTML string take over 100 times longer than subsequent calls?
问题 I had a need to display HTML text inside my iOS app. I have decided I will use the built-in method on NSAttributedString , initWithData:options:documentAttributes:error:. The actual parsing works excellently, however, I seem to have come across a very odd bug, that only seems to manifest itself if I have the debugger attached. The first time that this method is called, it takes barely under 1 second to run on my iPhone 5S running iOS 7.0.4, and about 1.5 seconds on an iPod Touch 5th