I have a nib that contains two TableViews. The table views are of the same class that I have created that is a subclass of a UITableViewController. I believe that everything is hooked up correctly. However, when I set the UITableView to the UITableViewController then run
[uitableviewcontrollervariablename reloadData];
I first get a warning that the class may not respond to reloadData. I thought all UITableViewControllers had a reloadData class?
I am trying to hook up these items incorrectly?
Update with code: TopicViewController.h
@interface TopicViewController : UIViewController {
NSInteger topicID;
Topic *topic;
IBOutlet ThoughtTableViewController *featured;
}
@property (retain) Topic *topic;
@property (readonly) NSInteger topicID;
@property (retain) IBOutlet ThoughtTableViewController *featured;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil ID:(NSInteger)ID;
@end
TopicViewController.m
@implementation TopicViewController
@synthesize topic;
@synthesize topicID;
@synthesize featured;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil ID:(NSInteger)ID {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
topicID = ID;
}
return self;
}
- (void)dealloc {
[topic release];
[super dealloc];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
topic = [[Topic alloc] initWithID:topicID];
NSArray *thoughts = [topic getFeaturedThoughts];
featured = [[ThoughtTableViewController alloc] initWithStyle:UITableViewStylePlain thoughts:thoughts];
[self.featured.tableView reloadData];
}
@end