Xcode 6 Error: Thread 1: signal SIGABRT


#1

Hi. I’ve managed to get around the Xcode 6 not having a blank application issue. However, the below lines of code relating to the UITableView are causing the following exception (the exception disappears and the applications works when I remove this line: [self.window addSubview:self.taskTable];).

Error:

2014-10-10 23:51:40.192 iTahDoodle[5610:578152] -[AppDelegate tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x78643b30
2014-10-10 23:51:40.198 iTahDoodle[5610:578152] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[AppDelegate tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x78643b30’

Code causing this error:

CGRect winFrame = [[UIScreen mainScreen] bounds];
UIWindow *theWindow = [[UIWindow alloc] initWithFrame];
self.window = theWindow;

CGRect tableFrame = CGRectMake(0, winFrame.size.width, 100, winFrame.size.height - 100);

self.taskTable = [[UITableView alloc] initWithFrame:tableFrame style:UITableViewStylePlain];

[self.window addSubview:self.taskTable];

Can someone please advise?

Thanks


#2

Looks like AppDelegate is the datasource of your tableview, but it doesn’t have the method tableView:numberOfRowsInSection: implemented.


#3

Looks like AppDelegate is the datasource of your tableview, but it doesn’t have the method tableView:numberOfRowsInSection: implemented.[/quote]

Thanks. Very silly mistake - realised I had began the ‘Wiring up the table view’ section but forgotten to actually finish it and write the remaining code which implements the required methods from the UITableViewDataSource protocol.