`UITableView` is a class used for displaying and editing hierarchical lists on iOS.

learn more… | top users | synonyms (12)

419
votes
23answers
166k views

Passing Data between View Controllers

I'm new to iOS and Objective-C and the whole MVC paradigm and I'm stuck with the following: I have a view that acts as a data entry form and I want to give the user the option to select multiple ...
288
votes
11answers
87k views

Using Auto Layout in UITableView for dynamic cell layouts & variable row heights

How do you use Auto Layout within UITableViewCells in a table view to let each cell's content and subviews determine the row height, while maintaining smooth scrolling performance?
83
votes
7answers
117k views

iPhone/iOS JSON parsing tutorial [closed]

As a learning experience, I want to make an iphone application that calls a webserver/webservice, retrieves a JSON response, and uses that response to populate the rows of a UITableView (assuming it ...
138
votes
18answers
70k views

Detecting which UIButton was pressed in a UITableView

I have a UITableView with 5 UITableViewCells. Each cell contains a UIButton which is set up as follows: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath ...
174
votes
5answers
153k views

ios how to pass prepareForSegue: an object

I have many annotations in a mapview (with rightCalloutAccessory buttons). The button will perform a segue from this mapview to a tableview. I want to pass the tableview a different object (that ...
5
votes
2answers
1k views

Objective C - how to add a subview that has its own UIViewController

I am struggling with subviews that have their own UIViewControllers. I have a UIViewController with a view (light pink) and two buttons on a toolbar. I want blue view to display when the first ...
188
votes
9answers
47k views

Can you animate a height change on a UITableViewCell when selected?

I'm using a UITableView in my iPhone app, and I have a list of people that belong to a group. I would like it so that when the user clicks on a particular person (thus selecting the cell), the cell ...
16
votes
8answers
8k views

How to know the UITableview row number

I have a UITableviewcell with UISwitch as accessoryview of each cell. When I change the value of the switch in a cell, how can I know in which row the switch is? I need the row number in the switch ...
149
votes
16answers
99k views

How do you load custom UITableViewCells from Xib files?

The question is simple: How do you load custom UITableViewCells from Xib files? Doing so allows you to use Interface Builder to design your cells. The answer apparently is not simple due to memory ...
106
votes
11answers
97k views

How to customize the background/border colors of a grouped table view cell?

I would like to customize both the background and the border color of a grouped-style UITableView. I was able to customize the background color by using the following: ...
64
votes
4answers
34k views

Tricks for improving iPhone UITableView scrolling performance?

I have a uitableview that loads fairly large images in each cell and the cell heights vary depending on the size of the image. Scrolling performance is decent, but can sometimes be jerky. I found ...
46
votes
14answers
52k views

Lazy load images in UITableView

I have some 50 custom cells in my UITableView. I want to display an image and a label in the cells where I get the images from URLs. I want to do a lazy load of images so the UI does not freeze up ...
157
votes
8answers
36k views

UIRefreshControl without UITableViewController

Just curious, as it doesn't immediately seem possible, but is there a sneaky way to leverage the new iOS 6 UIRefreshControl class without using a UITableViewController subclass? I often use a ...
162
votes
13answers
71k views

Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:

So I was making an rss reader for my school and finished the code. I ran the test and it gave me that error. Here is the code it's referring to: - (UITableViewCell *)tableView:(UITableView ...
151
votes
15answers
137k views

How to customize the background color of a UITableViewCell?

I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of ...
62
votes
11answers
50k views

Expand/collapse section in UITableView

Could somebody tell me the way to perform UITableView expandable/collapsible animations in sections of UITableView as below? or
112
votes
35answers
87k views

Making a UITableView scroll when text field is selected

after a lot of trial and error, I'm giving up and asking the question. I've seen a lot of people with similar problems but can't get all the answers to work right. I have a UITableView which is ...
70
votes
6answers
42k views

UITableViewCell with UITextView height in iOS 7?

How can I calculate the height of an UITableViewCell with an UITextView in it in iOS 7? I found a lot of answers on similar questions, but sizeWithFont: takes part in every solution and this method ...
37
votes
7answers
21k views

Any way to pre populate core data?

I've been creating a list app and backing it with core data. I would like to have a default list of say 10 airport's items, so that the user doesn't have to start from scratch. Is there any way to ...
99
votes
5answers
36k views

In a storyboard, how to make a custom cell for use with multiple controllers?

I'm trying (real hard) to use storyboards in an app I'm working on. In the app there are Lists and Users and each contains a collection of the other (members of a list, lists owned by a user). So, ...
11
votes
5answers
24k views

Custom Delete button On Editing in UITableView Cell

I have gone through this question that shows the following code: -(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{ return ...
29
votes
8answers
33k views

Lazy load images in UITableViewCell

I have some 50 custom cells in my UITableView. I want to display an image and a label in the cells where I get the images from URLs. I want to do a lazy load of images so the UI does not freeze up ...
17
votes
6answers
43k views

Grid view in iPhone SDK [closed]

I would like to create a grid view in my iPhone app similar to that shown in the iPad photos app. I know that the iPhone 3.2 SDK is under NDA, but is there a library or framework available for adding ...
13
votes
2answers
10k views

Observing pinch multi-touch gestures in a UITableView

I am looking to implement a pinch in/out on top of a UITableView, I have looked at several methods including this one: Similar question But while I can create a UIViewTouch object and overlay it ...
87
votes
16answers
42k views

Change Default Scrolling Behavior of UITableView Section Header

I have a UITableView with two sections. It is a simple table view. I am using viewForHeaderInSection to create custom views for these headers. So far, so good. The default scrolling behavior is ...
26
votes
17answers
33k views

Changing the size of the UISearchBar TextField?

I have a UITableView with an Index on the side; I want to add a UISearchBar to it, but the index overlaps with the "x" to clear the search. I've noticed in the Contacts application, the textfield ...
73
votes
16answers
30k views

Get notified when UITableView has finished asking for data?

Is there some way to find out when a UITableView has finished asking for data from its data source? None of the viewDidLoad/viewWillAppear/viewDidAppear methods of the associated view controller ...
37
votes
8answers
24k views

Getting row of UITableView cell on button press

I'm have a tableview controller that displays a row of cells, each of which have 3 buttons on them. I have numbered the tags for each cell to be 1,2,3. The problem is I don't know how to know on which ...
38
votes
8answers
31k views

How to detect the end of loading of UITableView

I want to change the offset of the table when the load is finished and that offset depends on the number of cells loaded on the table. Is it any way on the SDK to know when a uitableview loading has ...
37
votes
12answers
44k views

Is it possible to configure a UITableView to allow multiple-selection?

For the iPhone, is it possible to configure a UITableView such that it will allow multiple-selection? I've tried overriding -setSelected:animated: for each UITableViewCell, but trying to fudge the ...
7
votes
1answer
16k views

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 ...
68
votes
4answers
48k views

How to set the width of a cell in a UITableView in grouped style

I have been working on this for about 2 days, so i thought i share my learnings with you. The question is: Is it possible to make the width of a cell in a grouped UITableView smaller? The answer is: ...
44
votes
6answers
45k views

How to determine UIWebView height based on content, within a variable height UITableView?

I am trying to create a UITableView with variable height rows as explained in the answer to this question My problem is each cell contains a UIWebView with different (statically loaded) content I ...
41
votes
1answer
19k views

Tutorial on How to drag and drop item from UITableView to UITableView [closed]

I've been banging my head on this one for a while and I figured it out. I want to give back to the community since I've gotten a lot of help from this website :). I'm trying to copy an item from one ...
39
votes
9answers
30k views

UITableView set to static cells. Is it possible to hide some of the cells programmatically?

UITableView set to static cells. Is it possible to hide some of the cells programmatically?
25
votes
6answers
33k views

iPhone UITableView - Delete Button

I am using the 'swipe to delete' functionality of the UITableView. The problem is I am using a customised UITableViewCell which is created on a per item basis in - (UITableViewCell ...
22
votes
1answer
66k views

UISearchBar Sample Code [closed]

Implementing a searchbar can be tricky business and I'm struggling to make it work for my situation. Here's a collection of some of the sample code I've found for implementing a UISearchBar. Please ...
6
votes
4answers
24k views

How to display multiple columns in a UITableView?

I want to display multiple columns in a UITableView. For Example: TableView FName LName Age ----- ----- --- Abby Michale 34
0
votes
2answers
4k views

[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance

I am trying to parse a Json file into the Table view and I am getting this error [__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance and the app is crashing. Please help me, I ...
202
votes
8answers
52k views

Eliminate Extra separators below UITableView - in iphone sdk?

When I set up the tableview say with 4 rows, there are still extra separators lines below the tableview (or extra blank cells) How would I remove these cells (like in this case I just need 4 top ...
81
votes
16answers
74k views

Loading a Reusable UITableViewCell from a Nib

I am able to design custom UITableViewCells and load them just fine using the technique described in the thread found at http://forums.macrumors.com/showthread.php?t=545061. However, using that ...
52
votes
20answers
37k views

Dismiss keyboard by touching background of UITableView

I have a UITableView with UITextFields as cells. I would like to dismiss the keyboard when the background of the UITableView is touched. I'm trying to do this by creating a UIButton the size of the ...
43
votes
4answers
42k views

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 ...
55
votes
5answers
38k views

Is it possible to refresh a single UITableViewCell in a UITableView?

I have a custom UITableView using UITableViewCells. Each UITableViewCell has got 2 buttons in them. Clicking these buttons will change an image in an UIImageView within the cell. Is it possible to ...
68
votes
1answer
22k views

Table Header Views in StoryBoards

Is there a way to insert a Table Header View (tableHeaderView) in StoryBoard (like we used to do in Interface Builder)?
22
votes
7answers
12k views

UITableViewCell expand on click

Lets say we have a custom UITableViewCell So whenever I click custom button on cell.. it should expand to the some extent (you can say 40 height more...) and when i click again to the same custom ...
14
votes
2answers
5k views

Retrieve custom prototype cell height from storyboard?

When using "Dynamic Prototypes" for specifying UITableView content on the storyboard, there is a "Row Height" property that can be set to Custom. When instantiating cells, this custom row height is ...
246
votes
5answers
88k views

UITableViewCell, show delete button on swipe

How do I get the delete button to show when swiping on a UITableViewCell? I have followed this post, but the event is never raised and the delete button never appears!
90
votes
5answers
41k views

Long press on UITableView

I would like to handle a long press on a UITableViewCell to print a "quick access menu". Did someone already do this? Particularly the gesture recognize on UITableView?
135
votes
17answers
39k views

Why is there extra padding at the top of my UITableView with style UITableViewStyleGrouped in iOS7

Starting in iOS7, there is additional space at the top of my UITableView's which have a style UITableViewStyleGrouped. Here is an example: The tableview starts at the first arrow, there is 35 ...