I'm coming from the java world, where files/classes should be layed out well structured within packages/folders in my understanding.
What is the best practice in Xcode4? I couldn't find an Apple guideline for this yet. If anyone can push me to the right document, I'd be happy.
In case there is no document: what is the best to do so? I find it a bit odd to have all of the Classes in one project folder - either inside the Xcode-view or the file structure (strangely filestructure doesn't seem to equal the visual structure in Xcode). Of course the project will be on version-control (on GitHub).
Many thanks in advance!
First of all, I like to have categories of fire controllers and related classes grouped. But not just in groups created in XCode, in real folders too. So, when creating a group instead of creating it in XCode created it in Finder first, then drag that folder into XCode and have it formed into a group. Now when you add new files in that group they will also go into that folder on disk.
Some other random thoughts:
Naming: since you don't have namespaces, you must prefix your classes with a two or three-letter prefix (Apple recommends three). Do this even if it seems odd at first.
Resources: The default projects like to separate xib files from view controllers. In an app of any size, I greatly prefer to keep view controllers and xib files grouped in one location. You could even do images this way though generally there are few enough it's easier just to group those in one place.
Application stuff: I like to group all of the miscellaneous application specific files (app delegate, info.plist, pch file, main.m, etc) in one Application group at the top of the list to make those bits easy to find.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With