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.
Same problem when launching my application without debugging.
In my experience the produced binary does not seem to be the culprit.

I created an app from the xcode wizard which does launch OK in the simulator (let's call it testApp, my application being called myApp), I tried to figure out where is the difference with my app.

`otool -L myApp`
gives correct (relative paths) to the frameworks, same as testApp

`ps -E`
DYLD\_ROOT\_PATH, DYLD\_FALLBACK\_FRAMEWORK\_PATH, DYLD\_FRAMEWORK\_PATH, DYLD\_LIBRARY\_PATH environment variables needed by ld to locate the framework
are OK for myApp compared to the values of these variables when testApp is launched

I suspect that the problem lies somewhere in the communicartion between XCode and the simulator once the app is launched ... altough I can't find what's wrong ...

The solution that worked (at least for me) have certainly some big side effects but here it is :
quit xcode
browse the content of the package myApp.xcodeproj
unlock .model1v3 and .pbxuser for modification (the lock in the information panel (cmd-I on the file))
delete these two files
start xcode and retry to launch your application from there