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/CoreGraphics.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/
Related
I want to use a graph in my iPhone app. I have downloaded the source code Core- Plot for it, but now when I am trying to run it I am getting an error.
clang: error: -Z-reserved-lib-stdc++: 'linker' input unused when '-c' is present
Can anyone suggest me what this error mean or how to resolve it.
`iPhone, iPod Touch, and/or iPad Application
Dependent Project Install
Because frameworks cannot be used in Cocoa Touch applications in the same way as on the Mac, the means of including Core Plot within an iPhone application are slightly different.
First, drag the CorePlot-CocoaTouch.xcodeproj file into your iPhone application's Xcode project. Show the project navigator in the left-hand list and click on your project.
Select your application target from under the "Targets" source list that appears. Click on the "Build Phases" tab and expand the "Target Dependencies" group. Click on the plus button, select the CorePlot-CocoaTouch library, and click Add. This should ensure that the Core Plot library will be built with your application.
Core Plot is built as a static library for iPhone, so you'll need to drag the libCorePlot-CocoaTouch.a static library from under the CorePlot-CocoaTouch.xcodeproj group to the "Link Binaries With Libraries" group within the application target's "Build Phases" group you were just in.
You'll also need to point to the right header location. Under your Build settings, set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the Core Plot source tree. Make sure to make this header search path recursive. You need to add -ObjC to Other Linker Flags as well (as of Xcode 4.2, -all_load does not seem to be needed, but it may be required for older Xcode versions).
Core Plot is based on Core Animation, so if you haven't already, add the QuartzCore framework to your application project.
Finally, you should be able to import all of the Core Plot classes and data types by inserting the following line in the appropriate source files within your project:
import "CorePlot-CocoaTouch.h"`
Source: core plot wiki on google
I got a solution for it here is the link.
CorePlot failed to build in XCode 4.4
Basically the issue was related to Xcode.
I'm working on an application and everything was running in the iPhone and iPad simulator. But when was testing on the iPhone I received the following message:
Could not find a storyboard named 'MainStoryboard_iPhone'
But I can see and change the two Storyboards in Project Navigator. When I checked the Build Phases according to another question on SO, I found that there is something wrong but I don't know what to do. What is wrong?
This is the Build Phases, which I believe have a problem:
Thanks in advance.
Did you try to :
"Show in finder on both files"
"Save it to a safe place" >
"Remove file from Xcode (reference)"
"Add Files to your project" (With the 2 storyboards)
I'm using XCode 3.2.6. I'd like to make my game work for earlier version 3.1.3 but when I build the Project in Xcode, I'm getting the following error:
File /Users/.../build/Debug-iphoneos/libcocos2d libraries.a depends on itself. This target might include its own product.
And it's the only error. What's the meaning of this error? What's the issue here?
For some reason your Cocos2d library depends on itself. Open the properties for your Cocos2d library target (right click -> "Get Info") and look at the general tab. There's a list called "DirectDependencies". Remove the cocos2d library from that list.
Another place where a direct dependency could occur is the Cocos2d library product. Open the properties for your Cocos2d library product (this time under "Products" not under "Targets"). Open the targets tab and look at the targets. If the cocos2d library is checked as target, uncheck it.
Hi i am using iAd Banner in my test aap.It works fine with 4.0 Sdk but when i went with SDK 3.0 or before ,it crashes without showing anything.I read that weaklink will help me regarding this problem but as per my thinking it crashes when it doesn't find the framework.I do not even know that how to use Weak-link.Please help me to fix this problem.
Expand the Targets directory, right click , and choose “Get Info”. Click the Build tab, make sure “All Configurations” is selected, and navigate to Linking\Other Linker Flags. Double click on that entry, click the “+” button, and type “-weak_framework iAd”.
When allocating your ADBannerView, first check to see if the OS version supports it:
if(NSClassFromString(#"AdBannerView")) {
//Allocate ADBannerView here
}
Then in the build settings of your target, add -weak_framework iAd to Other Linker Flags in the Linking section.
Edited as per Jonathans recommendation.
No biggie, but when I add the AVFoundation framework for the iPhone, it turns red for some reason I'm unable to figure out why. The project will not compile unless I add this framework, and if I do, Xcode will mark the framework red (apparently that means xcode cannot find the framework), but yet it will work.
This is quite annoying. Any clue what I might be doing wrong here?
Try adding AVFoundation framework via your target.
Look for your target under "Groups and Files"
"Get Info" for it
Click the "General" tab
At the bottom right of the window click the "+" button
At the top of your list you should find AVFoundation, add it.
close Xcode
delete your project
shut down your mac
take the mac back to your boss and tell him it's not working
wait until they figure out what it is
if this doesn't work, find a new job that doesn't require the use of a mac
All I had to do was open up the "General" settings tab for the project and change the "Base SDK for All Configurations" value. It was set to an SDK that I no longer had installed.