Adding A New Resource File To Project

From rootshell wiki

(Difference between revisions)
Jump to: navigation, search
Elrusho (Talk | contribs)
(Initial writing of the steps and guidelines for adding a new resource file.)
Newer edit →

Revision as of 13:53, 3 May 2010

  • The name of the file should be : "mediaType_categoryName_objectName.fileType" for example: "image_background_spinImage.png" or "sound_effects_shoot.aif".
  • Here is a list of the different media types and the type of files that they contain:

Image: any form of image file. Could be a background, animated element, pictures, textures or ...
Sound: any form of sound file. Could be background music, sound effects, interface sounds or ...
Video: all video files.
Databases: any form of stored information. Could be an actual SQL file, text file, Localizable.strings files or ...

  • The project directory structure is as follows:
    Resource file.png

Other than the info.plist files, all other resources should be in the "Resources" director, in their corresponding media type directory.
If the resource belongs to a specific group it should be placed in that directory.
If the resource belongs to a specific version of the project then it should be placed in a separate folder (a folder with the name of the version).

  • The project group structure (the groups in Xcode) must be the same as the project's directory structure, so if you feel that the resource should be in a specific group then make the appropriate changes to the actual directory structure too.

  • Info.plist files should be added to the "Infoplists" folder (in the project's directory) and if there is more than one version of the project it should be in a folder with the version's name.
  • If the resource file is localizable, then there will be a "language.lproj" folder where the file ought to be, (two example of localizable folders are: "english.lproj" and "IT.lproj"). These localizable folders will be added automatically by Xcode, for more information on localizable files and localizing look at: Localizing Resource Files.

  • New resources and folders must be added to SVN.
  • If the resource is directly used by a class, it should be mentioned in the class' .h file, for more information look at the header comment in: Adding A New Code File To Project.
Personal tools