- (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.
_______________________________________________
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]