I download a sample of UICatalog and run it.When I compile it ,it shows the failed message:There is no SDK with the name or path \"iphoneos4.0\".I find the \"Base SDK\" of UICat
Steve nailed it. This is an Xcode bug. I loaded the NavBar sample and Xcode didn't even offer the simulator as an option, and it complained about the missing SDK even though it was set correctly in the project and wasn't set at all on the target.
Do what Steve said: "The only way I could resolve it (in fact, the only way I could get the option of running in the simulator at all) was to change from debug to release and back. The dropdown still shows Base SDK Missing but if you click it, the simulator options are there and it builds."