An hello world app ,but cause err "image not found"
Just a Hello world app. I create a view-based appllication named it Hello World. then save ,build and I double click the app under products. cause the error:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0
Dyld Error Message:
Library not loaded: /System/Library/Frameworks/CoreGra开发者_开发问答phics.framework/CoreGraphics
Referenced from: /Users/myname/Documents/Control Fun/build/Debug-iphonesimulator/Control Fun.app/Control Fun
Reason: image not found
I googled and tyied many ideas.Unluckily I can't slove it. Thanks in advance!
You can't run iOS apps directly on Mac OS X. You either have to run a build compiled for the simulator within the iOS Simulator, or a build for the device directly on your iPhone, iPod touch or iPad.
When you double-click the item in Xcode's Products group, you're essentially trying to launch the app directly. Just hit "Build and Run" instead and it should launch in the iOS Simulator or on an attached device, depending on your settings.
Btw: if this really is an iOS related question, you should remove or replace the "cocoa" tag from your OP. Cocoa is Mac, Cocoa Touch is iOS.
Plz check you project has CoreGraphics.framework. It would be defaulty included..but you might remove it by mistake.
You can check included frameworks on "General Tap" of project info.
You probably haven't included the CoreGraphics framework. To add it in do the following :
- Click on HelloWorld (ie ur project name) in the Project Navigator.
- Click on HelloWorld under the Targets in the Project Editor.
- Open "Build Settings" tab, and select "Link Binary With Libraries"
Now, you should see 3 libraries (at a minimum) in this section. They should be : UIKit.framework, Foundation.framework, CoreGraphics.framework (Note: In some cases the order is important so click and drag them into the order above)
Incase any of those 3 libraries are missing : Click the '+' (ie ADD) button and type in the name of the missing library. Select it, and hit add. Now run the project again and let me know if you have any more errors :D
Check out my blog for a simple tutorial on making your first iOS app : It teaches you Interface Builder, buttons, methods, etc : http://techtalktone.wordpress.com/2011/11/26/hello-world/
精彩评论