Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

interface builder what is Object template

in the storyboard there is a object entity that can be added to a view controller. My problem is i am not sure of its purpose. What is its usefulness and also can you show its usage and how the same thing can be done programatically. I've tried dragging the object template over to a viewController but i dont know what to do with it afterwards. I'll provide a screenshot of exactly what im looking for since its in the interface builder of xcode:

enter image description here

like image 258
j2emanue Avatar asked Dec 01 '25 16:12

j2emanue


1 Answers

This is useful to add an instance of a custom class. After you drag the Object into the document, you change its class on the Identity inspector. When the storyboard is loaded, an instance of that class will be created.

It's relatively uncommon to need to do it. You might add some custom controller object, but usually such responsibilities would be handled by the view controller or array/tree controllers. If you don't see a need, then don't worry about it. If, someday, you do find a need, well, then you'll know why it's possible.

like image 139
Ken Thomases Avatar answered Dec 03 '25 21:12

Ken Thomases



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!