Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GregInAZ

macrumors newbie
Original poster
In my XIB I have a view with it's own view controller (ViewController.m/.h). I also have a navigation controller that I dropped a tableview into. I created a table view controller class (CategoryViewController.m/.h) for the table view and hooked up the datasource and delegate to it. I added the following delegate methods to CategoryViewController.m:

Code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath


and in the CategoryViewController.h file I added:

Code:
<UITableViewDelegate, UITableViewDataSource>

So it looks like:
Code:
@interface CategoryViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {


In my ViewController.m class I'm trying to show the navigation with the table view in it using:

Code:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
[self presentModalViewController:categoryNavigation animated:TRUE];

categoryNavigation is synthesized in the ViewController.m class, it's a property in the .h and it's an IBOutlet and hooked up through IB.

When I execute this code I get an exception "EXC_BAD_ACCESS". If I remove the datasource connection in IB for the tableview and try again it shows what I wanted to see except that the table is empty.

Anyone know what I'm doing wrong?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.