On Nov 19, 2009, at 2:39 PM, Dave DeLong wrote:

> When I print out the size or rect that these return, I invariably get either 
> {0, 0} or something absurd like {{1.17076e-318, 2.29357e-314}, {2.30359e-314, 
> 2.1224e-314}} (that's just running the rect through NSStringFromRect())

Make sure the receiver (the NSAttributedString) isn't nil. The Obj-C runtime 
gives undefined results for a struct-based method return value if the receiver 
is nil; so you'll end up with garbage like this. (This is because it doesn't 
know at runtime how large the struct is, so it can't safely fill it in with 
zeroes.)

Put in something like NSAssert(str!=nil, @"str is nil"); before the call.

—Jens_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to