What can the "Object" in Storyboard's Object Library do?

Viewed 5644

Short Question

There is a thing called Object in XCode's interface builder's Object Library. I wonder what kind of task can be achieved by using this "Object".

Be specific, it is an NSObject in Storyboard (or xib). It's described as follow:

Provides a template for objects that are not directly available in Interface Builder. You can turn this object into an instance of any class using the custom class inspector.

Long Question

I'm trying to build a UITableViewController along with a UISearchController. Since they both require implement the UITableViewDelegate and UITableViewDatasource in their delegate, I wish I can assign the delegate of UISearchController to an Object other than the Main UITableViewController.

I'm looking for a way to achieve this in Storyboard, rather than assign the delegate manually in viewDidLoad. Especially, by figuring out how the Object work in Storyboard.

I understand that I can distinguish them by exam the UITableView's parents. But it is always good to separate the logic into different objects. It will be easier to implement, better efficiency, better structured and possible to be reused.

Thanks in advance.

What I have tried

  • Put an Object at the same level of the UITableViewController in the Storyboard (You cannot put the Object within another UIViewController).
    Link it with an @property (nonatomic, weak) IBOutlet NSObject * in the UITableViewController.
    The NSObject * turns out to be a nil pointer when I print it in viewDidLoad. No luck.
  • By changing the property to @property (nonatomic, strong), it become a UICustomObject instead of nil. Seems I'm on the right track.
2 Answers
Related