On 5/5/14, 6:27 PM, Pax wrote:
I believe that this should cause "IMAGE HERE" to be inserted at specific line endings. However, it often inserts into the middle of a paragraph instead - usually, but not always, close to where it should put the text. Furthermore, the positioning is usually at, or very close, to the correct location for the first instance of image insertion - and it gets progressively less accurate as it gets through the text. Is there some difference between the ways that strings are handled in NSAttributedString and NSString? Could there be some problem with characters like Non-Breaking Space?
You should probably reverse the order in which you insert strings/images/stuff. Whenever you insert something, the insert locations that follow this location calculated before inserting a new item will move backwards.
A simple way to get around this is to reverse the insert order, starting at the last index and moving towards 0.
Regards Markus -- __________________________________________ Markus Spoettl _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com