-1

Currently working on a graduation project on Swift (beginner) and i have encountered interesting error that i couldn't solve. I made my research but couldn't find anything useful. I am using UITableView for my project and every tab is similar to each other. Only difference is JSON url. Every page is working well but one page gives signal SIGABRT error at appdelegate.

Even though i have deleted everything at UIViewController, it still gives same error so i think its something deep. I admit that because of the similarities of the pages i might copy paste some labels to new View. Probably thats the case i have to deal with but i can't figure it out. I have checked the connections on the last bar at the right side of the panel, everything seems okay.

Edit: Here what it says on console when it crashes. Console Error

F.Fleur
  • 39
  • 5
  • There should be an error message in the debug console (see there: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/debugging_tools.html at the right bottom of the first screenshot) . Read it. If you don't understand it, show it here at least, we can guide you through another questions with the same issue or post an answer. – Larme Oct 19 '18 at 10:42
  • Add exception breakpoint, enable debug and run app. So that you'll get the exact line from where it is crashing..!! – Niki Oct 19 '18 at 10:49
  • I have closed that part of console somehow and couldn't find where to open it again, but i opened it with your reference so thank you. [Here what it says](https://i.stack.imgur.com/IwN6A.png) – F.Fleur Oct 19 '18 at 10:52
  • the error state, that UITableViewCell doesn't have a property called facultyLabel, so probably you need to set the class in your nib/storyboard file to your custom cell class, which inherited from UITableViewCell. – vikingosegundo Oct 19 '18 at 11:08
  • Inherit Module From target was unchecked, that was the error. – F.Fleur Oct 19 '18 at 11:26

1 Answers1

1

There are two mistakes from the log you attached:

  • Unknown class TeacherCell means that you probably assigned to a UITableViewCell the custom class named TeacherCell, but this class does not exist (or it's called in another way).

  • this class is not key value code-compliant for the key facultyNameLabel means that you probably have a label named facultyNameLabel in your storyboard/XIB but it is not present in the related swift file. Try to ctrl-click in every cell of your tableview and search for a yellow triangle.

ThugMazzola
  • 80
  • 1
  • 8
  • After you said TeacherCell not exists, i double checked but it seems that its true but i delete and re-write again and [this was](https://i.stack.imgur.com/41v4i.png) the problem. Before i write the name again, `Inherit Module From Target` was not checked. It auto checked when i write it again and it works perfectly now. Now this [errors](https://i.stack.imgur.com/MVUWT.png) left behind. Do you know what are these? – F.Fleur Oct 19 '18 at 11:24
  • Unknown class in Interface builder file is my silly mistake. I rename `FirstViewController` into something else and forget to change. – F.Fleur Oct 19 '18 at 11:31