• 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: Custom UITableView cell label with ARC and storyboards
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom UITableView cell label with ARC and storyboards


  • Subject: Re: Custom UITableView cell label with ARC and storyboards
  • From: David Duncan <email@hidden>
  • Date: Sun, 29 Jul 2012 19:48:09 -0700

On Jul 29, 2012, at 7:38 PM, Alex Zavatone <email@hidden> wrote:

>
> On Jul 29, 2012, at 10:30 PM, David Duncan wrote:
>
>> On Jul 29, 2012, at 7:02 PM, Alex Zavatone <email@hidden> wrote:
>>
>>> I've put together a TVC with a custom TVC cell class consisting mainly of UILabels, but have the problem where the labels will have varying amounts of lines of text.
>>>
>>> The main issue is that in iOS 5.x, UILabels still can't be vertically aligned to the top.
>>>
>>> There is a fair amount of source that explains how to add a label as a subView, but it is all non ARC code so, as cells get reused, the UILabel will get recreated whenever cellForRowAtIndexPath is called.
>>>
>>> Does anyone have ideas on when to remove the last subview of the content cell or how to check for presence of the view already so that It doesn't get to allocated again every time the cell displays in the cellForRowAtIndexPath code?
>>
>>
>> ARC really doesn't have anything to do with this. But my question would be why are you adding new labels in cellForRowAtIndexPath when you've already created a subclass of UITableViewCell? Have your subclass create (and maintain a reference) to these labels and never recreate them again.
>
> Well, because I could not get setting the frame size of a storyboarded UILabel to do anything at all in the
> UITableViewCell subclass and I could get the code to draw the label into the cell and add the subview to work.  That was very straightforward.

Are you resizing the label inside of -layoutSubviews?
--
David Duncan


_______________________________________________

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: Custom UITableView cell label with ARC and storyboards
      • From: Alex Zavatone <email@hidden>
    • Re: Custom UITableView cell label with ARC and storyboards
      • From: Alex Zavatone <email@hidden>
References: 
 >Custom UITableView cell label with ARC and storyboards (From: Alex Zavatone <email@hidden>)
 >Re: Custom UITableView cell label with ARC and storyboards (From: David Duncan <email@hidden>)
 >Re: Custom UITableView cell label with ARC and storyboards (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Custom UITableView cell label with ARC and storyboards
  • Next by Date: Re: Custom UITableView cell label with ARC and storyboards
  • Previous by thread: Re: Custom UITableView cell label with ARC and storyboards
  • Next by thread: Re: Custom UITableView cell label with ARC and storyboards
  • Index(es):
    • Date
    • Thread