• 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: UIView, UILabel, and sizeToFit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIView, UILabel, and sizeToFit


  • Subject: Re: UIView, UILabel, and sizeToFit
  • From: Matt James <email@hidden>
  • Date: Wed, 28 Apr 2010 22:22:59 -0400

On Apr 28, 2010, at 9:14 PM, Roland King wrote:
>> - (void)setRepresentedObject:(NSString *)aString
>> {
>> 	name.text = aString;
>> 	[name sizeToFit];
>> 	[self sizeToFit];
>> 	NSLog(@"Container size: %d, %d", self.frame.size.width, self.frame.size.height);
>> 	NSLog(@"UILabel size: %d, %d", name.frame.size.width, name.frame.size.height);
>> }
>> I tried the code with both %d and %i - the results seem to be the same.
>> Thanks for any help you can provide!
>
> That was Fritz' whole point, the sizes are floats, not integers so you have to use %f to print them. He wanted to see your code to ensure you were *not* using %d or %i.
>
> As someone pointed out, there are methods NSStringFromCGRect() and NSStringFromCGPoint() which convert things to strings for you.

OH!  Now I see.  I thought he meant that one was right and the other was wrong.  And now Luke's post makes a lot more sense too.  Ugh, what an idiot.  Thanks for the help, everyone!  Sorry to waste your time. :)

-Matt_______________________________________________

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

References: 
 >UIView, UILabel, and sizeToFit (From: Matt James <email@hidden>)
 >Re: UIView, UILabel, and sizeToFit (From: Fritz Anderson <email@hidden>)
 >Re: UIView, UILabel, and sizeToFit (From: Matt James <email@hidden>)
 >Re: UIView, UILabel, and sizeToFit (From: Roland King <email@hidden>)

  • Prev by Date: Re: NSKeyedArchiver and NSPoints
  • Next by Date: Re: advancementForGlyph problem
  • Previous by thread: Re: UIView, UILabel, and sizeToFit
  • Next by thread: Re: Differences in NSFileWrapper -initSymbolicLinkWithDestination: and -initSymbolicLinkWithDestinationURL:? [SOLVED]
  • Index(es):
    • Date
    • Thread