last day (15 days later) » 

8:04 PM
1
Q: 'NSInvalidArgumentException' - [UIViewController tableView:numberOfRowsInSection:] - unrecognized selector sent to instance

sentyI know this is dublicate question (and extremely sorry), but I've tried everything I've found on SO so far, but I am still receiving error this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecog...

 
who is owner of TableView1.xib, it must be TableView1.swift
 
@vadian That's right. TableView1.swift and it's .xib should be the child of ViewController.swift & Main.storyboard
 
select tableview1.xib and locate owner on top left
 
@Alok, is it tableview.xib > File's Owner > and? . It's custom class > class is TableView1 and Module > Current..
 
now in attribute inspector there are some tabs (i am missing name). it looks like custom class, module same as you have attached in your question screen shot
 
8:04 PM
@Alok tableview.xib > File's Owner > custom class > class is TableView1 and Module > Current..
 
can you just break connection in xib for data source and delegate, just break it and run see if crashes still
hi
 
Yes, I did that you said: It runs without errors, but Unknown class Table in Interface Builder file.
 
without crash ??
 
Without crash
 
you are conflicting your statement "It runs without errors", then you are saying "Unknown class Table in Interface Builder file."
are u saying without crash but with warnings?
 
8:08 PM
yes, that's right. What I mean is without crash & with logs in Console. Maybe that is happening because of I have this line in ViewController.swift: let controller : UIViewController = UIViewController(nibName: "TableView1", bundle: nil)
I just added some more Screenshots at the bottom of the OP
 
your tableview1 subclasses to ?
 
I think my problem was caused of that line actually. I'm trying to call UITableViewController but I wrote UIViewController instead. I fixed it. but how can I connect the delegate methods again? I can't do that anymore :S
 
instead of xib
please try just undo
 
My main/parent controller is ViewController and child is table.
 
just undo for getting your change of xib
 
8:15 PM
Runs without errors thanks. My answer was changing let controller : UIViewController = UIViewController(nibName: "TableView1", bundle: nil) to let controller : UITableViewController = UITableViewController(nibName: "TableView1", bundle: nil). Thanks a lot!
 
so no crashes now
can i post as answer and appreciate you if you accept
 

last day (15 days later) »