cnicollonline

"I was just guessing at numbers and figures, pulling the puzzles apart"

While sitting in my Objective-C class learning about the Tab Bar Application and it’s uses our teacher brought up a point in that Apple’s pre-made Tab Bar Application, is good… but not great. The problem is that it starts you up with two views (which is good), However the first view is the main controller. The second view has it’s own controller assigned to it. After a little research and a quick modification to the Tab Bar Application I was able to create my own template that I now use for Tab Bar projects.

To start off, and as my teacher suggested it’s probably best for the project to have 3 different controllers.

  1. MainController which connects the NIB MainWindow.xib
    • This will be the main view in which links the other view’s to the tab bar
  2. FirstViewController which connects the NIB FirstView.xib
  3. SecondViewController which connects the NIB SecondView.xib

To create a custom template:

NOTE: It’s probably a good idea to quit xCode.app before going ahead!

  1. Download the template here
  2. Within the Finder open: ~/Library/Application Support/Developer/Shared/Xcode/
  3. If a folder doesn’t exist, create a new folder called “Project Templates” within that directory
    • You should now have a directory like “~/Library/Application Support/Developer/Shared/Xcode/Project Templates/
  4. Create a new “Category” (new folder). In my case I called in “Custom Templates” within /Project Templates/
  5. Drag the “Tab Bar Application [Modded]” folder within your newly made Category folder
  6. Launch xCode and it should all be there and working!

Write a Comment