I have a view which displays a UITableView
with a section index along the right side. This was working perfectly when the controller class was a UITableViewController
, e.g. in the .h file I had
@interface MyClass : UITableViewController
However, I wanted to make the table view have an image background. I changed the xib
file so it had a UIView
that contained the UIImageView
for the background and the UITableView
for the table with a transparent background, and changed the .h file to
@interface MyClass : UIViewController <UITableViewDelegate, UITableViewDataSource>
The view, delegate and datasource are all set to the appropriate objects and everything works fine with the table. The background shows through and the table functions properly. But the section index is no longer displayed along the right side of the table.
There were no other code changes and I can get the section index back by changing the controller's view to be the UITableView
and changing the .h file appropriately, but then the background image doesn't show.
What is the correct way to get a section index on a UITableView
that's inside a UIView
?