sagarkothari
sagarkothari

Reputation: 24820

technical way of managing files - grouping files in xcode

I am in iPhone development since last 3 months.

Usually, While inserting a view Controller, I just right click on Classes & add new group.

& Within that group I just add my new view controller's .h, .m & .xib file.

Before my question, let's see what I have done in my project.

alt text http://img230.imageshack.us/img230/4191/picture4kz.png

My questions are something like this

Upvotes: 1

Views: 622

Answers (2)

JT.
JT.

Reputation: 31

Adrian Kosmaczewski explains an approach known to experienced Xcode developers. It's the method I use and it "makes a place for everything and puts everything in its' place". Hope you find the article, linked below, what you're looking for. Moreover, his blog is one of the best around.

http://kosmaczewski.net/2009/07/28/code-organization-in-xcode-projects/

Upvotes: 3

fbrereto
fbrereto

Reputation: 35945

To answer your items in order:

  • The "proper" way here depends on personal preference, though there are methods that can be easier to maintain and navigate than others. Therefore there really is no all-encompassing "proper" way.
  • Again, this is a matter of personal preference. All of the projects I have worked on professionally have had some fundamental organization based on the type of file. Thus in a given project you would have one directory for resources, one for headers, one for sources, etc.
  • .xib files don't "have" to be anywhere locally on the disk or even located under any special directory in the XCode project. The XCode build system will recognize the .xib file as a resource by its extension, compile it, and put the result in the proper location. (Note that this assumes the file is listed under your targets "Build resources" step.
  • If you find yourself with many source, header, and resource files, I would recommend gathering them all together into three separate folders organized by type. The relationship, then, between the folders is established by the names of the files (e.g., AskPassword.h is related to AskPassword.m is related to AskPassword.xib).
  • For the answer to this question you would have to ask Apple.

I hope that helps!

Upvotes: 1

Related Questions