On Apr 28, 2010, at 12:50 PM, Fritz Anderson wrote:
> On 27 Apr 2010, at 8:56 PM, Matt James wrote:
>
>> Unfortunately, NSLog-ing the values of label.frame.size.width and
>> containerView.frame.size.width shows that the values are "0".
>
> Show us your code, particularly all the lines that call NSLog. The first
> thing I'm looking to see is whether you're trying to print the width with %d
> or %i.
>
> — F
Hi Fritz,
Thanks for the reply. I've included the code below. I was originally testing
only the widths of those views which was coming out zero. In the code below,
however, I changed it to output both the widths and heights. Of interest, the
heights are coming out abnormally large and the widths are still zero.
To give you some background, the container view that uses this code is used as
an item view in my own implementation of an NSCollectionView (since that class
is not available on the iPhone or iPad.
- (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!
-Matt_______________________________________________
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]