This is a great read before you start on your project.
In particular it talks about:
- Good coding practices when dealing with memory. When to use init vs autoreleased objects.
- Managing memory with retain/release/copy.
- When you use weak reference vs strong ones (eg. delegates).
- Using Clang to debug your code.
- Other ways to make your development more friendly when you throw memory errors.
Whenever adding a new external project or library to your XCode project you have the potential to enter dependency hell. In my case, I was using TouchJSON for some of my own uses and another library I was using was also using TouchJSON. The compilation error would show that both that library and my build had references to the same named .o file.
A more complex scenario when including two different external static library and they both include the same external library. Do you just go with first come first server or do you exclude it from both projects and include it at the top-level (your) project?
Anyway, to fix the former case one has to simply exclude the .o files from being added to the .a. How did I do this?
Hopefully you have the source to the third-party’s project. Open the project.
Click on Targets. Then click on the specific target generation the .a file. Open it.
You will see Copy Bundle Resources and Compile Sources. Find the files that are causing the duplicate symbol errors and remove them.
By doing this, you will be able to compile your project but the .o files will not be included in the .a file.