質問

On the left hand side of Xcode, in the "Navigator" pane, in the "Files" view, is a list of all the various files that make up my project.

I am currently working through an introduction to Sprite Kit. I noticed that I created some of my new files for the project outside of the directory structure. The files exist in the Application structure, but at the top level, like the ApplicationGraphics, ApplicationTests, and Frameworks directories.

Am I setting myself up for problems later as things get more complex? Currently everything works fine, although I am somewhat reluctant to start grabbing things and moving them around for fear that the project may start breaking in subtle ways.

I have other files for graphics, which I've put in an ApplicationGraphic directory; where is the preferred place for the sound files to live?

役に立ちましたか?

解決

I noticed that I created some of my new files outside of the directory structure

What you see isn't really a directory structure in the sense of a file system directory. The yellow "folders" are just groups -- you can use them to keep related files together, and to make it easy to hide or reveal sets of files. More than likely, all those files reside in the same file system directory.

Blue folders, on the other hand, are references to actual file system directories.

Am I setting myself up for problems later as things get more complex?

No. You can group files however you see fit. If your files are in the project, Xcode will find them no matter how you group them. If you're talking about actual filesystem directories, that can have a greater impact on Xcode's ability to find things. If you add a blue folder (directory reference) you might not want to move the files it contains to other places. It's much more common to use groups (again, yellow folders).

I am somewhat reluctant to start grabbing things and moving them around for fear that the project may start breaking in subtle ways

Shouldn't be a problem. If you're worried, go slow at first. Move a few files into a group, build, and repeat until you've convinced yourself that changing groups won't hurt anything.

I have other files for graphics, which I've put in an ApplicationGraphic directory; where is the preferred place for the sound files to live?

I'm not sure that there's a "preferred" location. It often makes sense to store like files together, of course, and resources like sounds are often kept in a project subdirectory. But do what works for you, and change it when you need to. There's nothing magical about file locations, and you should be able to keep things working no matter how you organize your files.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top