Adding a New File

  • Choose File > New File.

  • Select a template family for your platform.

  • Select a file template.

  • Select the appropriate options for your template.

  • Click Next.

  • Name the file and click Finish.

  • Prerequisite

      (None)

    Related

      (None)

    Definitive Discussion

    ../Art/adding_a_new_file.jpg

    You can create files of various types (such as source code, nib files, or resource files) to add to your project. The New File dialog organizes templates by platform and template family.

    Most of the generated files contain predefined content to get you started. For example, source-code files may contain basic implementations of key functions or methods.

    When you create a file, Xcode also asks you to choose the project and target the file belongs to. In most cases, accept the preselected options. Xcode adds the new file to the project directory of the current project.

    After creating new files, Xcode highlights them in the Groups & Files list.