iOS compliation problems with apache cordova

When running the following cordova command:
cordova build ios

The build process can fail and produce an error message similar to the one below:

fatal error: file '/Users/joebloggs/project/platforms/ios/my_app/my_app-Prefix.pch' has been modified since the precompiled header '/var/folders/nv/05rr28xn0fq0khjcbw0h6clr00011t/C/com.apple.DeveloperTools/6.1-6A1052d/Xcode/SharedPrecompiledHeaders/my_app-Prefix-gfledpkguusngdfzkfgyavgbgbjn/my_app-Prefix.pch.pch' was built
note: please rebuild precompiled header '/var/folders/nv/05rr28xn0fq0khjcbw0h6clr00011t/C/com.apple.DeveloperTools/6.1-6A1052d/Xcode/SharedPrecompiledHeaders/my_app-Prefix-gfledpkguusngdfzkfgyavgbgbjn/my_app-Prefix.pch.pch'
1 error generated.

** BUILD FAILED **

This problem can occur after removing and re-adding your iOS platform or when switching git branches etc.

The solution is to remove the file mentioned in the error above, in this example the following file would need to be removed to resolve this issue:

rm /var/folders/nv/05rr28xn0fq0khjcbw0h6clr00011t/C/com.apple.DeveloperTools/6.1-6A1052d/Xcode/SharedPrecompiledHeaders/my_app-Prefix-gfledpkguusngdfzkfgyavgbgbjn/my_app-Prefix.pch.pch

After the file has been removed, run the build command again and all should be good.

Last updated: 01/12/2014