Possible issues with upgrading to Snow Leopard / XCode 3.2?
I'm one of a pair of programmers working together on iPhone / iP开发者_如何学Cod applications. I'd like to upgrade to the new version of XCode (3.2) and Snow Leopard, but chances are my partner won't. Can anyone highlight any problems we might have sharing code? Are there incompatibilities between the old and new, or should we be able to share code / projects happily?
Any help / warnings would be appreciated.
If you do decide to attempt dualing OS/Xcode environments at the very least you should set your shared Xcode project's project setting "General" tab, Project Format to "3.1" because if you upgrade the project to 3.2 the 3.1 Xcode may have problems opening it.
I've got two machines in this situation, one of which is SL/3.2 and one Leopard/3.1. For the one project that I share between the two, it seems to work. But as Mark points out, there's no guarantee that it will work in all cases.
I have not tried this, but it may work to have you use the project file in 3.2 and your partner use a 3.1 project file. Don't check it in, only work with the source files from source control, keep your project files local. I've done this between versions of Visual Studio, which is what prompted the idea, but though it sounds good in my head I've no idea how well it would work in practice.
Another alternative is to keep two versions of Xcode on your machine (search SO or iphonedevsdk.com for the how-to). I've done that through the OS 3.0 betas, but that assumes Xcode 3.1 lives happily on a SL machine. Probably the safest one to try, as the worst would be that 3.1 won't install or run on SL.
Don't do it. The Xcode project files are notoriously fragile, and aren't always compatible between versions. When they make known-incompatible changes between versions, you'll get a warning opening the files on the new version. There's no such warning for 3.2 vs 3.1, but that doesn't guarantee that you won't have any problems.
I should probably clarify that I don't mean that you should never upgrade, just that you and your partner should upgrade at the same time.
Your partner should update. It's only $29! There are a lot of useful new features, and the time is about an hour total (a bit longer if you include backup, but you are both already doing regular backups anyway, RIGHT?).
I was on a mixed team with 3.2 and 3.1 for a while, and it did work - but that was one or two XCode updates ago.
You could optionally both keep different project files and each add new files as the other added them, to be really safe...
I agree you should upgrade, but beware, you may need to tweak your code.
I particularly noted a difference in the way NSAlert works. In 10.5 I passed a variable "window" as a parameter and that created a sheet that opened on that particular window. In 10.6 the exact same code generated a modal dialog. I then changed "window" to "[self window]" and the sheet was back.
I also have a small problem with Core Data, where it throws the warning "Failed to call designated initializer on NSManagedObject class XXX" even though this code was fully tested under 10.5.
I believe there were other smaller problems but I fixed them along with real bugs and didn't make note of them.
精彩评论