Domanda

Are Custom Objects (the little orange cubes) still supported when using storyboards?

Details: I was making a sample iOS App using storyboards and I added a custom object mapping a class which only had a button and a method for that button and I started getting strange errors. I removed this custom object and added the button and the method to the view controller class and everything worked as expected; this lead me to believe that something changed in the way custom objects worked when using storyboards, am I correct?

È stato utile?

Soluzione

The orange cubes only instantiate objects at wake-up. They're not really meant to add views. For example I use a few orange cubes to instantiate extra UIViewControllers and then I link them to outlets in my parent UIViewController. This gives me a nice clean way to create a number of child UIViewControllers for the parent UIViewController. It was pretty much the same as pre-storyboard IB as well. If you wanted a view, the you would add the view. If you wanted an object you could instantiate it by IB or manually in the UIViewController.

Hope this helps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top