Search code examples
iphoneobjective-cxcodeinterface-builderxcode-template

Iphone sdk - How to setup a 'template'


I've been working on a Cook Book App and I've been making each page individually which takes a really long time to do, I asked a question similar to this and it was brought to my attention that you can setup a way to automate the design process so all you need to do is input your data.

Can someone please explain in as much detail as possible how you setup your xcode files/code to automate such a process

So for example I would just enter the page text and it would automatically put my standard background picture in and add a scroll view and appropriate buttons etc. Thanks


Solution

  • You could make one master view that contains all the controls that you need: standard background picture, scroll view, appropriate buttons, etc, and make any subsequent views that you create inherit from this view, so that they all contain those controls.

    You could also use just one view and work with multiple instances of it, one instance per page. Just make sure to have a Text property on it, or a constructor that takes in your text string, so that you could set it to a different text on each page.