Use parseProjectFile when working with XCode projects.

Otherwise the changes get overwritten by the cached version of the project file.
Add a unit test to guard against similar bugs in the future.