Tag: uitableview

Dynamically size uitableViewCell according to UILabel (With paragraph spacing)

I have a UITableView which is populated by text and images from a JSON file. The TableView Cell is currently sizing correctly for “posts” that do not contain many line breaks in the text however I cannot get it to calculate the correct height for “posts” with 4 or 5 line breaks. Code for getting […]

How to give space between two cells in tableview?

I want a space between two cell in table view, I want cell like this, How can i do that?

iPhone – dequeueReusableCellWithIdentifier usage

I’m working on a iPhone app which has a pretty large UITableView with data taken from the web, so I’m trying to optimize its creation and usage. I found out that dequeueReusableCellWithIdentifier is pretty useful, but after seeing many source codes using this, I’m wondering if the usage I make of this function is the […]

iPhone – What are reuseIdentifiers (UITableViewCell)?

From the official documentation: The reuse identifier is associated with a UITableViewCell object that the table-view’s delegate creates with the intent to reuse it as the basis (for performance reasons) for multiple rows of a table view. It is assigned to the cell object in initWithFrame:reuseIdentifier: and cannot be changed thereafter. A UITableView object maintains […]

How to use the first character as a section name

I’m using Core Data for a table view, and I’d like to use the first letter of each of my results as the section header (so I can get the section index on the side). Is there a way to do this with the key path? Something like below, where I use name.firstLetter as the […]

How do I make UITableViewCell's ImageView a fixed size even when the image is smaller

I have a bunch of images I am using for cell’s image views, they are all no bigger than 50×50. e.g. 40×50, 50×32, 20×37 ….. When I load the table view, the text doesn’t line up because the width of the images varies. Also I would like small images to appear in the centre as […]

iPhone :UITableView CellAccessory Checkmark

In iPhone App on click of table view cell I want to display Table view cell Accessory type Check mark for that on didSelectRowAtIndexPath i am writing code if(indexPath.row ==0) { [tableView cellForRowAtIndexPath:indexPath].accessoryType=UITableViewCellAccessoryCheckmark; } and displaying check marks. but in my case i wnt to allow user to check only on cell at a time […]

Select tableview row programmatically

How do I programmatically select a UITableView row so that – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath gets executed? selectRowAtIndexPath will only highlight the row.

UITableView issue when using separate delegate/dataSource

General Description: To start with what works, I have a UITableView which has been placed onto an Xcode-generated view using Interface Builder. The view’s File Owner is set to an Xcode-generated subclass of UIViewController. To this subclass I have added working implementations of numberOfSectionsInTableView: tableView:numberOfRowsInSection: and tableView:cellForRowAtIndexPath: and the Table View’s dataSource and delegate are […]

Scrolling a UITableView inside a UIScrollView

I have a UITableView which is a subview of a UIView, then that UIView is a subview of a UIScrollView. How do I detect the touches that should scroll the UITableView? The UITableView can get item selection events (a cell in the table is selected/tapped) just fine, except that you have to hold down on […]