On 17/05/2013, at 11:38 PM, Koen van der Drift <[email protected]> 
wrote:

> // calculate the size it occupies
> 
>    CTFramesetterRef framesetter = 
> CTFramesetterCreateWithAttributedString(attrString);
> []


> // draw the string:
> 
> []

>    CTFramesetterRef framesetter = 
> CTFramesetterCreateWithAttributedString((CFAttributedStringRef) attrString);


Don't create the framesetter object twice. I'm not sure it has a bearing on 
your issue, but it would make sense that the framesetter used to calculate the 
frame should be the exact same one that draws the frame. It might be that 
creating it and calculating the size performs some caching that speeds up the 
second use. In any case it will use less memory if you only use one.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to