All Questions

1274
votes
26answers
435617 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 (itself/automatically), while maintaining smooth scrolling performan...
330
votes
9answers
330381 views

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 hold...
43
votes
2answers
27367 views

How to add a subview that has its own UIViewController in Objective-C?

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 butto...
81
votes
10answers
74746 views

How can I debug 'unrecognized selector sent to instance' error

I am creating a custom table cell view for my table view. After I connect an image view of custom cell (in storyboard) to my code in swift, I get the following error. [UITableViewCellContentView imag...
197
votes
25answers
128122 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 *)in...
350
votes
17answers
107536 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 gr...
102
votes
6answers
135809 views

iPhone/iOS JSON parsing tutorial

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 c...
273
votes
21answers
190662 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 man...
304
votes
20answers
168053 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 *)tableVie...
36
votes
10answers
14830 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 va...

Previous Next