0

Overriding functions viewDidAppear and viewDidLoad doesn't seem to work. I tested by printing to the console, nothing comes out. The rest of the function body doesn't execute either.

I made sure the method signature is override func viewDidLoad().

The View Controller class is not directly the subclass of the UITableViewController class.

There is a class:

class EntityVC<E: Entity>: UITableViewController {
    var dataRetriever: DataRetriever<E>!
    var cachedEntities: CachedEntities<E>!
    var entityName: String!

//Other functions...

then this View Controller class extends to it:

class StallTableVC: EntityVC<Stall>, UISearchBarDelegate {

To clarify, StallTableVC is what the storyboard is hooked to, NOT EntityVC.

Would that have something to do with it? I realize this is also the reason why in the storyboard, the View Controller class does not appear in the list of suggestions, however I made sure it was selected.

nsinvocation
  • 7,559
  • 3
  • 41
  • 46
Berry
  • 2,143
  • 4
  • 23
  • 46
  • I did this, although Xcode complained that the class couldn't be visible to objective C as it is a generic class subclass. – Berry Dec 29 '16 at 23:50
  • Could this be an issue with reaching the scene (ignoring the fact that it's generics)? What happens if you assign another class to it? A plain `UIViewController` for instance – Doug Mead Dec 30 '16 at 00:02
  • If I replaced the generic superclass with a simple `UITableViewController`, then yes, it would be visible to the storyboard. – Berry Dec 30 '16 at 00:03
  • Thanks. This solves it. – Berry Dec 30 '16 at 00:36

0 Answers0