Admob Integration - iphone

I'm trying to add admob to my app and I'm confused with step 4 which is
Under Other Linker Flags, add -all_load to both Debug and Release.
Is that under OTHER_LDFLAGS? How would I exactly do this? Thanks!

Do this:
1. Go to target seetings of your project.
2. Now go to Build settings. In Search bar type " Other Linker Flags ". As shown below in image will appear on screen.
Now add -all_load to both Debug and Release.

Check this image to set Other Linker flag. hope helps.

Related

Conditionally link a third party API in Xcode

I have a third party API that I am trying to integrate into my iOS Universal application. The API works fine if ran on a device but throws me a compile time link error when trying to run it on the simulator. So, is there a way I can skip their static library linking if I run on the simulator?
Thanks
Actually, It's a lot easier than I thought.
Step 1: Add the linker flags -ObjC and -all_load to your target. This tells the objc runtime that even if we don't reference a class in code, it will still load it into memory.
Step 2: In your code, you can do this:
Class cls = NSClassFromString(#"SomeClassInStaticLibrary");
if (cls == nil)
{
// on the simulator
}
else
{
// on the device, use the class like usual
id myInstance = [[cls alloc] init];
}
Unfortunately, you have to refer to everything as an id, because if you include the headers, you WILL get a linker error.
Its a bit of a hack, but it works.
What you can do is build the Static Library as a FAT one. Compiling for both architectures armv and i386 to run in the simulator.
You can find more information about this here,
http://mark.aufflick.com/blog/2010/11/18/making-a-fat-static-library-for-ios-device-and-simulator
You can control this setting in the Xcode (4.3) Build Settings tab of your target. Where it talks about "Other Linker Flags" you can add a conditional setting (click and hold the lower right "+" icon that says "Add Build Setting" by default). Here you can specify the library to link using normal -l/-L linker flags but only for builds specified as "Any iOS SDK", but don't add this flag for "Any iOS Simulator SDK".

application executable is missing a required architecture

I'm attempting to upload my first app to the app store using xcode 4.3, but can't get past this error... "application executable is missing a required architecture. At least one of the following architectures must be present: armv7" I looked up the issue. Their are several post on stackoverflow addressing the issue, but none of the suggestions listed worked. I attempted to add armv6 and armv7 to the build settings, but the errors still persist. Any suggestions would be welcomed. Thanks.
screen shot here..
http://dl.dropbox.com/u/2813968/Build%20Settings.png
For Xcode 4.5 at least, set the deployment target to at least iOS 4.3 and that will resolve it. Earlier versions of iOS and armv6 are almost extinct.
Make sure that these settings match your Target and not just your Project settings.
1) Left-click project icon (blue icon, under "Run" button).
2) Next to the project icon (to the right of it), left-click on project name under "PROJECT" (White background).
3)Select tab "Build Settings" and look for tab "Build Active Architecture Only" -----change to -----no

XCode 4 Adding Run Script Build Phase Grayed Out

I am trying to select "Add Run Script Build Phase" under "Editor" > "Add Build Phase" in XCode 4, but the option is grayed out. Does anyone know why this would be happening? Thanks!
This is now different...again...in XCode 6. There's a "+" button in the top left corner of the Build Phases area that will give you the New Run Script Phase option. I'll come back after the NDA has lifted to post screenshots.
In case this wasn't answered, the step by step on adding a run script build phase is posted at http://runscriptbuildphase.com. It has the steps for Xcode 4 and Xcode 3.
Screenshot of new 'plus' icon initially mentioned by #d2burke for those who have had difficulty finding it in Xcode 6 +
Did you select your target and there the build-phases tab in the main view? then it should lighten up
hth
I'm new to Xcode too, but after googling same problem,i found that the solution is very simple.
you should press on your target( left panel, then u click on Build phase (not build setting) ), after that you can add new build phase settings.
I was just working on this same problem with XCode 5. Even if you are already on the "Build Phase" tab, you need to click Build Phase, then immediately click Editor --> Add Build Phase

Compatibility problem iAd Banner?

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.

Adding CorePlot to iPhone Project - Errors?

Linker information below
Followed the directions.
Any ideas on how to fix?
Followed directions for install. I'm using Xcode 4.0.
Thanks, J
Did you follow the instructions? Make sure you add -ObjC -all_load -lCorePlot to Other Linker Flags.
Rechecked instructions and dragged CorePlot-CocoaTouch.xcodeproj into project properly. Solved the problem. Hope this helps someone else ;)
You need to include Foundation.framework in your "deleteTest" target. Select it then go to "Build Phases", you will see one of the phases as "Link Binaries and Libraries", expand this and click the + sign in the bottom left of this list. Add the Framework from this list.
There I found a good link for using Core-Plot having detailed explaining how to add it to project & use the delegate method of Core-Plot.
http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application
It worked g8 for me. Hope you would be able to do the same ,yesterday only I did the same thing from here.