Question: I have an existing project that I was working on, and I recently decided to update my iPhone SDK and updated to the latest 3.0 SDK.

I update my SDK and go to open my existing project. Sure enough, there are some problems including some certificate problems and so on. Anyway, google and I were able to solve most of them, but I haven't had any luck on what I hope to be the last of my problems.

When running my program in the simulator, I now get

> 
> dyld: Library not loaded:
>  /System/Library/Frameworks/UIKit.framework/UIKit
>  Referenced from:
>  /Developer/iGameLib/iGameLib/build/Debug-iphonesimulator/iGameLib.app/iGameLib Reason: image not found
> 
> 
> 

Now, I discovered the UIKit has moved to 

> 
> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0sdk/
>  System/Library/FrameWorks/UIKit
> 
> 
> 

and I have updated my target and project settings to point to that new framework location, but still when I build it, no luck.

I have also tried clearing out the simulator's applications and settings, still no luck.

The referencing .app is cleared when I run the "clean" menuitem, I have confirmed this, so clearly something in my project settings are still pointing to use the old UIKit location.

**Where should I be looking?**

I've gone as far as I can to help myself but I'm afraid I'm at a loss here. I don't see it under the target settings, or the project settings, or the plist, or any of the other files within my project.

Answer: 
I was getting the same error

dyld: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit

The solution on my case was simply quit Xcode and try again.
I had the same problem using Xcode 3.2.1 but it was solved in an easier manner. I realized I had recently disabled my target's environment variables, specifically ones to do with memory debugging (NSDebugEnabled, NSZombieEnabled, NSAutoreleaseFreedObjectCheckEnabled, MallocStackLogging, MallocStackLoggingNoCompact). The app ran once in the simulator after removing the environment variables but never again after that.

Quitting Xcode, the Simulator, restarting Xcode and doing a complete clean of the target (including it's dependencies off course) brought me back to a good state.