Looking for the best way to set-up an iPhone project in XCode … namely:
-
What is the preferred project template to start with (e.g View-Based or Windows-Based application)?
-
What folder structure should I create in XCode to manage the project? For example, under “Classes” is it a preferred practice to add Models, Views and Controllers sub-folders?
Any other best practices, tips, etc… would be appreciated.
Thanks
Take the most “complicated” template, based on your level of knowledge. I usually start out with the “Window-based application” myself, and add components one at a time from there.
I keep all of my code (.m/.h/.c/etc) in the “Classes” folder and only rarely add subdirectories to it. One exception is a “Generated” subdirectory for classes generated from Core Data entities.
When I create a new
UIViewControllersubclass, I rename the resulting .xib to remove the “Controller” part; i.e. MyViewController.m gets paired with MyView.xib. (I think MyViewController.xib reads funny, as the xib isn’t for the controller, it’s for the view.) I also move the .xibs into their own directory next to the project file to keep things tidy.