Reputation: 11201
I'm having trouble connecting a TableView (I think this is my error, maybe is another one), I have this error:
-[NSObject tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x796aaa0
This is a problem connecting, isn't it?
This is my notice.h:
#import <UIKit/UIKit.h>
@interface Notice : UIViewController <UITableViewDataSource, UITableViewDelegate>
{
UITableView *mainTableView;
NSMutableArray *contentsList;
}
@property (nonatomic, retain) NSMutableArray *contentsList;
@property (nonatomic, retain) IBOutlet UITableView *mainTableView;
@end
in notice.m, I have the usual methods for UITableView implementation.
this is my interface builder:
Thank you in advance
Upvotes: 0
Views: 40
Reputation: 7333
First set the Tableview delegate and datasource in the xib. You are getting this error because you have declared the these protocol in .h method but haven't implemented the @required methods of datasource in .m method. Implement two required methods of tableview datasource . This might solve your problem.
Upvotes: 0
Reputation: 125037
You've connected your table's data source outlet to 'First Responder' when in fact you should connect it to your view controller. They're not the same thing. The First Responder icon is a proxy for the "first responder", i.e. the current first object in the responder chain. It changes depending on the state of your program, and it's not likely to point to your view controller.
Upvotes: 1