IOS: UITableViewCell - objective-c

In my project I would create a table view with 10 row, but these 10 rows must be UITableViewCell customizable. Do you suggest links where I can find some suggest code?

The Table View Programming Guide for iOS has three different approaches: Programmatically Adding Subviews to a Cell’s Content View, Loading Custom Table-View Cells From Nib Files and Subclassing UITableViewCell.
Have a look at this tutorial as well.

Related

Proper way to build custom UITableViewCell

I've been wondering about UITableView's and their cells for a while. UITableView is a very handy UIView subclass, but there is a lot of predetermined/forced content on a UITableViewCell. I was wondering what is the best way to create a custom UIView (which will end up being a UITableViewCell) for UITableView?
The cell has a certain style that has to be set and there are predetermined UILabels and accessory views that are completely immutable, other than their contents. I find this to be a big waste, but just giving the cell a custom content view (and background view, if one pleases) doesn't prevent or remove these processes or restore the memory.
Is there any way to create a lighter version of a UITableViewCell subclass? Or is there a way to use a UIView with a selection method instead (other than essentially creating a custom UITableView using UIScrollView)?
Any suggestions would be really appreciated.
There are a few methods:
From a XIB file:
ios steps to create custom UITableViewCell with xib file
http://www.icodeblog.com/2009/05/24/custom-uitableviewcell-using-interface-builder/
Using Drawing:
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
http://developer.apple.com/library/ios/#samplecode/TableViewSuite/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007318 (4th and 5th examples)
There doesn't seem to be an answer for this. UITableViewCells will always have UILabels and other views automatically added to them. I'm not sure if they are allocated before you set them, though. They may have custom setting / allocation methods.

iOS custom UITableView and UITableViewCell with columns (Twitter app)

I'm developing an iPhone/iPod application, and the designer used a lot of these "Twitter App Concepts" (screenshot). As you can see, the TableView has a shadow and the cells can be split in columns (those columns are clickable).
I just need to create those columns, any idea how I can accomplish that?
The prettykit library is probably a good place to start, as the library is a subclass of UITableViewCell and UINavigationController.
http://cocoacontrols.com/platforms/ios/controls/prettykit
Well a UITableViewCell is a UIView so in your tableView:cellForRowAtIndexPath: when you hit that row simply add 3 subviews to the UITableViewCell.
There is one downside to this approach though and that is if there are a lot of these "Column Cells" then it will hinder performance. You also tend to want to avoid more then 5 subviews in a UITableViewCell
In case you are wondering "Why can't i just add multiple cells to a Single Row?"
Good question and the reason is UITableView's dequeueReusableCellWithIdentifier: (Reference) this takes an Index Path which is a combination of the Section Number and Row Number the Cell is in.
As it only returns a single cel, it's impossible to return multiple cells (unless you write a custom implementation), but you can return a cell with multiple subviews that has a unique identifier ;)
UITableViewCell Class Reference
UIView Class Reference
Edit: The library that danielbeard linked looks to be a good implementation to use.
Use your own subclass of UITableViewCell instead of UItableviewcell. And Customise your cell as you want.

Storyboards and Table View Sections

I've noticed that in Storyboards, when dragging out a Table View object from the Library, you also get a chance to configure table view sections, and bunch of other options. For example, if the content is going to be static cells or dynamic prototypes, etc.
Here's a look at the Table View in Interface Builder (.storyboard file):
and here's how the Table View looks like in a .xib file:
So my question is - is it possible to configure/style (drag buttons, images, etc. into cells) a table view in a .xib file using Interface Builder or it can only be done programmatically?
Can be done either way. I prefer doing it in IB as the layout is much easier when you can see what you are doing. For dynamic prototypes, you only design a single cell and the contents will be populated in the cellForRowAtIndexPath method. With a Static Cell tableview, you can design the whole thing (many sections and many rows). The requirement for a Static Cell tableview is that the class HAS to be of type UITableViewController, while for Dynamic Prototypes, it can be either a UITableViewController or (my preference for more flexibility) a UIViewController with a UITableView.
Hint - if this is a Static cell tableview and you only design a screen full of sections and rows, be sure to turn off scrolling for the tableview.

No content attribute for UITableView in .xib

(XCode 4.2, iOS 5)
In order to reuse a tableview (with a navigation bar and edit/add buttons) I created a UITableViewController subclass with it's own .xib. However, when I add a UITableView to my .xib's main view the content attribute (which I want to set to dynamic prototypes) it doesn't show up. It just shows the sample content (California: Brea, Burlingame, ...). When I add a UITableView in my main storyboard the content attribute does show up.
What is the issue?
For people trying to solve this, it is impossible to set dynamic prototypes cells in a .xib, or even static cells. No embedded sections or cells are supported in .xib files.
If you drag a Table View Controller into a .xib, you'll get an error:
Table views with embedded sections and cells are only supported in
storyboard documents
Xcode 6.3.2

How to show a .xib file in a TableViewCell

I have a .xib with an image and a label in the potition that i want..
And i want in the cellForRowAtIndexPath function to set image and label.text then to add then view in the cell and show the cell
Check this:
How do you load custom UITableViewCells from Xib files?
But i do not recommend to load UITableViewCells from xib.
You loose performance on a very critical part.
I recommend to create you UITableViewCell subclasses by code. Because inflating a XIB(XML) during scrolling will create buckings.
If you wan't to have a nice, snappy app, then code instead of XIB (at least the UITableViewCell subclasses).