• 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
iOS table views using multiple cell subclasses.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iOS table views using multiple cell subclasses.


  • Subject: iOS table views using multiple cell subclasses.
  • From: Alex Zavatone <email@hidden>
  • Date: Wed, 22 Oct 2014 10:19:14 -0400

On my past two gigs, I've spent a fair amount of time subclassing UITableViews and UITableViewCells.

Yesterday another programmer came to me with a question where he wants to plop text of variable lines into a custom footer in his table view.

Sure, that will work, but honestly, this looked Ike a perfect case for another subclass of table view cells, but in another section.

Since time to investigate this approach is non existent, hopefully you guys clarify some preconceptions here.

Since the tableView has a registerNib method, does that imply only one type of custom cell?

If it doesn't, is it conceivable to have cell reuse identifiers for each type of cell subclass? Assuming here we could do something such as "if in section one, display these cells, otherwise display these other cells" or even, "we have data of this type, use this type of cell subclass".

I've become very familiar with the need for cell contentView clearing within the cell's prepareForReuse method with custom cell creation.  If registering more than one nib to allow for multiple cell types for a table view's cells is supported, this would great, but I assume that the methods for cellHeightAtIndexPath would have to properly cast the cells based to handle variable cell height as well.

TL;DR: can table views use multiple cell subclasses each with their own XIBs? If so, how?

Thanks in advance,
Alex

Sent from my iPad. Please pardon typos.
_______________________________________________

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: iOS table views using multiple cell subclasses.
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: RE: Return values of NSAlert
  • Next by Date: Re: iOS table views using multiple cell subclasses.
  • Previous by thread: RE: Return values of NSAlert
  • Next by thread: Re: iOS table views using multiple cell subclasses.
  • Index(es):
    • Date
    • Thread