• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value


  • Subject: Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
  • From: Benjamin Stiglitz <email@hidden>
  • Date: Mon, 30 Mar 2009 09:55:41 -0400
  • Mail-followup-to: email@hidden

> I'm running the code below. I have a single NSWindow with a checkbox and
> a button. In the awakeFromNib method of the main controller, I change the
> attribute of the checkbox string. In the compute: method, I compute the
> height requested to display a string for a specific font and maximum
> width.
>
> If I run this code as is, I get 17.0 as the required height. That's
> incorrect.
>
> If I comment the awakeFromNib code, I get 34.0f as the required height.
> That's correct.

Is this the code exactly as it is in the app? e.g. compute: doesn't
depend in any way on the values you set in -awakeFromNib? (I think this
is your complaint, but I'm just verifying.)

Not that this fixes your problem, but
-[NSAttributedString boundingRectWithSize:options:] would probably be a
bit easier for you to use.

-Ben
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
      • From: Iceberg-Dev <email@hidden>
References: 
 >[BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value (From: Iceberg-Dev <email@hidden>)

  • Prev by Date: Re: NSDates and natural language ...
  • Next by Date: Re: ack no class
  • Previous by thread: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
  • Next by thread: Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
  • Index(es):
    • Date
    • Thread