I'm trying to download Xcode 4.0 for my Mac and they want me to upgrade to Lion and download 4.1. Is there a way to download 4.0 without having to change my entire operating system?
The App Store only distributes one version of each app. Xcode 4.0 is no longer available as Xcode 4.1 replaced it.
If the author of the software wishes to keep an older version on the store, the new version has to be uploaded as a different sellable item.
In this case, Apple didn't choose to leave both.
You can get multiple versions of Xcode by joining the paid developer programs. Last time I checked, Xcode 3 was available with the free account. It runs on Snow Leopard - but it doesn't look like you can buy Xcode 4.0 anymore without a paid developer account - it might not even be available to the developers - you might ask before paying money if you really need 4.0 and only 4.0.
Here’s a link to Xcode 3.2.6 for Snow Leopard that I found on developer.apple.com. I couldn’t find versions 4.0 or 4.1.
The site https://developer.apple.com/downloads has a search field. Enter "Xcode" and you will see "Xcode 3.2.6 and iOS SDK 4.3 for snow leopard". You can download a non App Store version of Xcode from there after signing up as a developer.
You can get assorted versions of Xcode all the way back to Xcode 2.3 it seems. You can do this without a paid account, but, you do have to register as an Apple Developer.