XCode 3.2 does not include an ideal template for creating a Navigation-based Universal App. Apple has said that iPad apps should respect all device orientations. Meaning if you turn the device, the app should redisplay in the new orientation.
Getting the Navigation Bar and Orientation working correctly can be a little tricky to accomplish if you don't start out with a good template. It's fairly simple once you understand the required elements, but that can be a painful process. I created this template to save time. The template is also configured for Core Data. If demand exists, I will create a version without Core Data.
The template is hosted at github. The following commands will install the template in your local XCode templates folder.
mkdir -p "$HOME/Library/Application Support/Developer/Shared/XCode/Project Templates/My Templates"
cd "$HOME/Library/Application Support/Developer/Shared/XCode/Project Templates/My Templates"
git clone git://github.com/benellingson/Universal-Navigation-based-Application.git
rm -rf "Universal-Navigation-based-Application/.git"
Once the template is installed it will appear under "My Templates" when you create a New Project.

If you find this helpful or have suggestions, please leave a comment.








Hi
ReplyDeletewhen i run the third command i face the following issue :
Permission to benellingson/Universal-Navigation-based-Application denied to...
Can you please tell what i need to solve this.
Thank you for sharing this
ReplyDelete@Narinder: benellingson should be replaced in the paths with your username.
ReplyDelete@Narinder: I misread your question. The corrected answer is to clone from the read-only URL:
ReplyDeletehttp://github.com/benellingson/Universal-Navigation-based-Application.git
So the corrected syntax would be:
git clone http://github.com/benellingson/Universal-Navigation-based-Application.git
Thanks Matthew! I have updated the instructions.
ReplyDeleteHi Ben,
ReplyDeletenice application template!
A couple of suggestions for improvement (things I've adjusted after using the template):
It would be nice if both RootViewController_Pad and RootViewController_Phone derive from a common RootViewController_Shared; there are undoubtedly things that the 2 controllers can share.
I've also made the following modification to both AppDelegates:
[super application:applicationication didFinishLaunchingWithOptions:launchOptions];
right after the // Override point comment marker; and added an empty method returning just YES to AppDelegate_Shared.m. I use this so I have a common place where I can bootstrap models that are common to both iPad and iPhone.
Hi Ivo,
ReplyDeleteThanks for the feedback! Next time I get a chance to hack on this.. I'll implement the RootViewController_Shared suggestion.
I think there are a lot of simple improvements/options that should be made available for app templates.
- Ben