-2

I have a table view set up in IB. It's delegate/datasource are connected to this class:

@interface EditPlayersViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {

I'm trying to call the reloadData method. If I use [self.view reloadData]; it doesn't respond, I guess because technically self.view isn't a UITableView. I tried to add the following:

IBOutlet UITableView *myTableView

and then I connected it to my table view in IB. Now my program crashes when the view loads. Any ideas?

superfell
  • 18,780
  • 4
  • 59
  • 81
kend0g187
  • 31
  • 1
  • 4

3 Answers3

0

Make sure you have implemented the UITableView data source methods. put break points in data source methods and try to find out where it is crashing.

UITableViewDataSource_Protocol/Reference

prashant
  • 1,920
  • 14
  • 26
0

Make EditPlayersViewController a subclass of UITableViewController rather than UIViewController. Dump the explicit interface implementations and the IBOutlet. Then, [self.tableView reloadData] should work.

TroutKing
  • 817
  • 1
  • 9
  • 15
0

Watch the console when it crashes and then bring up the debugger window. Both of these windows will give you great insight into what is happening. The data you're trying to load may be to culprit and not the reloadData call.

v01d
  • 1,576
  • 14
  • 19