What are the benefits of using Spice? Xcode can already import source from other projects.

Using Spice for Xcode can save time, especially when you regularly create new projects. Once you have created a set of Spices - for example with several custom controls, custom categories, Facebook Connect, etc, it takes only seconds to add these to a new project. Even adding a couple of source files from another project can be faster using Spice, if they have dependencies on system frameworks or require conversion between ARC and non-ARC projects.

Can Spices contain references to my code? I don't want to duplicate my source code.

Spice for Xcode v1.1 can now create references to existing code, so the original source files can be shared between projects. The Spice file just contains a file reference to the original project, and when this is added to a new project, you can decide if the source file should be duplicated or if a reference to the original source file should be added instead.

Isn't it a bad idea to copy source code between projects?

This depends on your way of working. If you have a finished custom control, Spice for Xcode allows this to be ‘archived’ in a Spice so that it can be reused. Changes can then be made to the original code without needing to worry if the changes will break the other projects using it. Once the custom control updates have been finished and tested, you can create a new Spice, and upgrade to this on a per-project basis. Also, if you are including code from a third-party library, you may not want to keep the old projects around, so Spice for Xcode can become a handy archive for these.

Can I change the folder name that Spices are added to in my project?

Yes. The default folder group name is called ‘Spices’. To change this, open Preferences -> General, and change ‘Name of Spice Group’.

Where is my source code stored?

For Spices which contain copies of your code, they are stored in the Spice file itself, which are stored in the Library folder under your user home folder. These can be thought of as similar to zip files containing the source code, as well as other settings.
For Spices which contain references, the code is never copied from the original project and so this should not be moved otherwise referencing projects will not be able to locate the code. When a Spice containing references is exported, the source code is automatically added to the Spice file.

Can I share Spices between developers?

Currently Spices can be exported to a shared network drive, Dropbox, or other shared storage, and then imported into Spice by another developer. In future versions we plan to add automatic syncing and iCloud support.

What exact changes are made to my Xcode project?

Spice for Xcode can make several changes when adding a Spice to your project.

When adding source code, resources or user libraries, each file is either copied to your project in a subfolder to your project source or a reference is added to the originating project. For each target selected in the toolbar (the default is all), the file is also added to the build steps from the original project - i.e. if it is a resource, it will be added to the bundle resources step, if it a compiled file, it will be added to the compilation step.

If added non-ARC code to an ARC project, the -fno-objc-arc compiler flags will be added to each compiled file, if requested. Similarly, adding ARC code to a non-ARC project will add -fobjc-arc flags.

When adding user libraries (i.e static .a libraries which reside in the project), linker options will automatically be added to enable the correct linkage. In this case, the '-ObjC -all_load' flag will also be added. (See tech note: http://developer.apple.com/library/mac/#qa/qa1490/_index.html )