Missing Frameworks iOS 4.0 - iphone

I've just updated xcode to release 4.0. A lot of the frameworks in my App are now highlighted in red, they appear to be missing. i.e. MapKit.framework
Is 4.0 not backward compatible with 3.1.3 ?
Regards,
Stephen

If your project is working with 3.1.3 well, then do the following:
1. In XCode left pane, select your project name, right click (control click) and select "Get Info".
2. In Build tab, change the Base SDK to iPhone Device 4.0 (your latest downloaded SDK)
3. Similarly also repeat above steps after selecting "Project" menu -> Edit active target.
Then close your XCode and restart XCode.
All your frameworks will be available now.

However this change (by itself) will prevent your app from loading on a 3.1.x device. That's because the new setting "iOS Deployment Target" (introduced with the 4.x SDK) will default to the same value as the Base SDK you just set. You have to change this new setting (it's in the "Deployment" group) to the earliest iOS device your app will support.
Now your app will run on any device running that version or later of iOS. But there's a new wrinkle. If you add code to your project that uses classes or methods introduced in 4.x, you'll get no warning of that in the Simulator, yet it will crash when called by your 3.x device. You have to wrap such calls with code that tests the runtime version of the device, and only make the calls if the runtime version supports those calls.
This is all discussed in detail here: Install xCode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs, which includes links to discussions of how best to code these runtime checks.

Related

How can I support both iOS 4.X SDK and iOS 5 SDK in my iPhone app?

I am writing an iPhone app in which I want to support the largest user base possible at this point in time (with minimal pain), so I decided that targeting IOS 4.3+ would be a good subset of users for my audience.
I started working in XCode 4.2, but reverted back to XCode 4.1 when I realized that the project templates had changed and everything seemed very intertwined with storyboarding, ARC, etc.
I have built out my application to the point I actually want to test on my device, which has iOS5 installed. When I attempt to use it though, I get this message as soon as I click 'use for development' in Organizer/XCode:
The project's build settings look like this:
My Question Is This: How do I get this application, built in XCode 4.1, to run on both iOS 4.3 and iOS 5 phones?
Are iOS SDKs not backward compatible? I come from Android development in which a less than current SDK will generally work on a newer SDK - is this different in the iOS world? And if so, how is this handled typically?
Any direction on how I should proceed would be greatly appreciated.
You can go ahead and open your app in Xcode 4.2 and it should still work. I've been working on a particular app since Xcode 3.x days and I'm nearly done, chugging along in Xcode 4.2 right now. It shouldn't be a problem. If you want to work with Xcode 4.1 you will be fine, but you won't be ale to use new features introduced in iOS 5.
There are several aspects of "cross-version" development to note.
Testing: You can only test on version of iOS that are included with your SDK, or that are installed on physical devices that you may have. The SDK generally comes only with the latest iOS, sometimes the previous one is included as well, but since Xcode 4 was released, the older SDKs have been progressively deprecated with each release. This is not to say that your app which is linked against the iOS 5 SDK won't run on older versions of iOS. It just depends on how you implement new features.
Features: In order to support older versions of iOS properly, you want to make sure that you don't implement new features without properly checking for the existence of classes, methods, and properties that were introduced in the newer versions of the OS. Unlike Android, you don't have to worry about a million hardware configurations. ;-)
Weak Linking: To support a new feature and still be compatible with older versions of iOS, you need to weak link against frameworks that you are using to implement new features. You can read more about that in the Apple Documentation on Weak Linking.
Deployment Target: The setting that prevents the app from loading on older devices is called the "Deployment Target". If you set this to 3.1.3, then your app will run on iOS 3.1.3 and higher. Remember that if you don't code the the proper version checking, your app may break.
ARC: You can choose to enable or disable Automatic Reference Counting when you create the project. ARC scans your program at compile time only, not at runtime, it doesn't break the app on older versions of the OS.
You need the latest version of XCode and the iOS SDK to install your apps onto your iOS 5.0 phone. That doesn't mean the inverse is true -- you don't need the same version of iOS on your device that you have installed on your computer.
Hope this helps!
You can use the latest SDK and simply set the "IOS Deployment Target" version to 4.3 in the project build settings.
XCode 4.1 doesn't support iOS5 in the sense that Xcode package doesn't contain the iOS5 SDK. So you must return to Xcode 4.2 and target your project for iOS 4.3 (you can also target it for iOS 4.0 with this Xcode version, but you will not be able to simulate it; you can even download older iOS 4.x package versions from the Xcode preferences menu if you really need to simulate them in your device).
You can opt-out of ARC if you want, this choice is given to you when you create the project, so don't worry; but consider that ARC does its magic at compile time only, not at runtime, so your backward compatibility will be kept if you decide to use this technology. Finally if you don't want Storyboard just pick the Empty app template and it will simply put in your project only the basic files. From this template you can create any iOS app, this is the approach I normally follow.

How to display all SDK versions of iphone/ipad in simulator selection list?

I'm unable to choose the lower than 4 version of SDK simulator in the simulator selection list in xcode4. There are iOS SDK 4+ (for iPhone) and iOS SDK 3.2 (for iPad) simulator versions only. I have set IPHONEOS_DEPLOYMENT_TARGET = 3.1 but nothing changes.
In the project editor choose your build target and then choose the summary pane. In the summary pane there is a drop down box where you can choose the deployment target. This may or may not help because it sounds like you're already changing the variable directly in the build settings.
Seems like we need to download and install previous version of Xcode and SDK. All the versions could be found on Apple's developer site. Also, there is one simple instruction that can be found here:
http://iosdevelopertips.com/xcode/download-and-install-older-versions-of-xcode-xcode-previous-releases.html

how can i run iphone 2.0 in iphone 3.2 sdk

hi i am new to iphone.i am installing the iphone sdk 3.2 with xcode 3.2.when i run the some pre defined examples it shows an error there is no sdk named iphone2.0.If i need to install iphone sdk 2.0 how can i install with out overriding the existing sdk means i need both sdk 2.0 and sdk 3.0. how can i done this pls help me.thank u in advance.
You don't. You always build/compile against the latest SDK. in your case that's 3.2. Just set your deployment target to 2.0 and you will run those devices - that is if you don't rely on features of later versions.
Just as a not: if you plan to submit you app to the AppStore, you must use 4.x and target 3.x minimum.
change the base SDK instead by scrolling down the list on the left in XCode and expand "Targets". Click on the name of the app inside this and press the blue info button at the top in the middle.
Make sure you have the "Build" tab selected and that you choose "All configurations" in the configuration drop down.
Then change the base SDK to 3.2. Its about the 3rd option down I think.
Hope that helps.

apple not currently accepting applications built with this version of the SDK?

My binary was rejected with the error above as the reason. I checked my xcode settings and under the "General" tab of info I have the Project Format set to Xcode 3.2 compatible which is the highest available. I have the Base SDK Configurations set to iPhone Device 4.0 - also the highest available. In the "Build" tab, I have the Base SDK set to iPhone Device 4.0. I have all of them set to the highest, how can they not be receiving these types of apps?
EDIT: I confirmed that I am using the newest version of Xcode (3.2.3) and I never had the beta test version installed - this is my first app. I have confirmed that every single place that I can find - the OS is set to 4.0. No matter what I seem to do - I still get that same error message when trying to upload the binary.
Decompress your app (via show contents) and have a look at info.plist in a text editor such as textMate (its a binary file). Search for the key iphoneos the following numbers are the version.
This will confirm what version it was built with.
Are you sure you are using the latest version of Xcode and the SDK to compile? Maybe you still have one of the beta versions installed and that's the reason for the rejection.
A certain combination needs to be made. The Base SDK needs to be set to 4.0 and the target SDK needs to be set to 3.2.

There is no SDK with the name or path 'iphoneos2.0'

I keep getting this error.
There is no SDK with the name or path 'iphoneos2.0'
I am running some templates at
http://appsamuck.com/day1.html
I'm running the latest sdk, in the pop up menu (simulator) there is an option iPhone Device 2.0 (missing) (Base SDK)
Then just select another SDK: 3, 3.2 or 4.
Most examples will work, even if they were prepared for SDK 2.
Oh, i have just met this problem last night :) I think your project write in xCode 3.2.2 or earlier but you try to run it on xCode 3.2.3. And you need to tell xCode to run your app in iPhone Simulator with iOS 4 (iPhone running iOS 4 can run iPhone's app write for iOS 3). If that's your problem do some step to slove it:
Select "Project" menu on xCode.
Select "Edit Project Settings" submenu.
Look at line "Base SDK for All Configurations", select iPhone Simulator 4.0 (May be it look like disable but you can select).
Run your project to compile your project.
Good luck :)
Looking at the code here, it's one of the very first iPhone dev tutorials written, and it's evidently not been updated to reflect the current SDK and Xcode versions.
I would suggest starting with a more modern tutorial, then coming back to this once you have the confidence to be able to understand and fix the code.
Go to the project
project> Edit project Setting
Change BASE SDK to the latest IOS
after that
Code Signing Identity: Change it to DON'T CODE SIGN
after doing this some of my applications was working fine but not all of them.