I have developed an application using xcode 4.3.2 with ARC enabled ,my app users having ios3.2, ios4.0,ios5.0 devices how can I give support to lower version ios device uses .Should I need to do anything in code side . or Is there any way set ARC dynamically like.
Any have any idea regarding this plz share with me.
Thanks
ARC is not device- or OS-dependent (see note below). It is a LLVM compiler feature (which can be disabled using the -fno-objc-arc compiler flag). The compiler manages the memory instead of the programmer. The final executables will not be very different from one another and will work on the minimum OS specified for your project (if you are not using ARC-specific keywords, etc.).
Note:
According to Apple's Transitioning to ARC Release Notes from Apple, ARC-compiled executables will only run on iOS 4 and above. In addition, weak references are only supported on iOS 5.
Just set the target deployment to the lowest iOS version your users might be on.. AutoMatic Reference Counts only while compiling the app in Xcode. The memory of app enabled ARC is managed by compiler (Xcode). So you need not to worry about the target iOS version of the device. Just set the Target Deployment to 3.2 or 4 etc.
I think at least it is not guaranteed to work correctly on iOS 3.x. See Transitioning to ARC Release Notes from Apple:
ARC is supported in Xcode 4.2 for Mac OS X v10.6 and v10.7 (64-bit applications) and for iOS 4 and iOS 5. Weak references are not supported in Mac OS X v10.6 and iOS 4.
Related
We were supporting iOS 6 & 7 previously for our universal iOS application (which means we support both iPhone and iPad). Now, with the release of iOS 8, we have to support iOS 6, iOS 7 & iOS 8. Also, we have to extend our targeted device list to support iPhone 6 and iPhone 6 Plus.
Also, we are planning to upgrade to Xcode 6 shortly. Because Apple may anytime mandate the use of Xcode 6 to be able to submit apps to app store.
Keeping all the above points in mind, I am confused what should be my Architecture settings in Xcode build settings. Mainly There are 3 important items under Xcode Architectures settings. Please see the below screenshot.
I have highlighted the 3 important parameters. I want to know what values I should assign to these parameters in order to support all the above. Any help will be greatly appreciated. I am confused a bit with this.
Also, I would like to know if i need to change anything else in order to migrate to Xcode 6 and iOS 8.
In Architectures, you'll be fine with armv7, armv7s, arm64, i386, where i386 is for the Simulator. The rest can be left default values.
UPDATE: It is not required to mention desktop architectures (i386, x86_64) in order to support the build for iOS Simulator. Given Simulator is supported just by including respective ARM architecture. Hence, Architectures are fine if populated just with armv7 armv7s arm64. By observing, since Xcode 6.3 it might even cause build to fail if the setting contains any of the desktop architectures.
Valid architectures can be set individually for each target, Xcode will make intersection of the global Architectures setting with this. If you are not interested, leave it untouched, Xcode will cope with that on its own without problems.
In case your code is not 64bit ready, remove arm64 from Architectures. App will still run on iOS 8 and all the recent 64bit devices.
As for the Build Active Architecture Only, I recommend setting it to No. This property affects what Xcode decides to build e.g. based on currently connected device. But it may happen problems arise: you may end-up with some targets are built for different architecture, resulting in linking errors. Nevertheless, if you would like to use the pros of the feature, set it to Yes just for Debug or some sort of configuration used only for testing, not the final release. Xcode will build all binaries only for one of all the architectures you have set in Architectures x Valid then.
If you're not an expert on your target architectures, remove all architectures and add armv7 and armv7s. Also, if you're building only for iOS, check your targets so that Xcode isn't building other OSes (that may require other architectures).
I'm trying to compile sources with Xcode 4.6, for 32bit architecture, but getting this error:
error: -fobjc-arc is not supported on platforms using the legacy runtime
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
What's wrong?
You're mixing ARC (automatic reference counting) with the older Objective-C 1.0 runtime, which does not support ARC.
32-bit apps on OSX, automatically use the 1.0 Runtime, so you'll have to disable ARC for your project, and use Manual Reference Counting.
This problem recently resurfaced because Xcode 5 removes the ARCHS parameter - if you let it. But if you have a build server with Xcode 4 this defaults there to building 32 and 64 bit, which fails if you have ARC enabled.
See my writeup for a more detailed explanation.
I am learning about Objective-C/Cocoa and have downloaded the source code to a popular TeX typesetter and loaded up the project in XCode to play around with it. Compiling fails, and all of the error messages I have seen (so far) have to do with something called NSSharingServicePicker not being recognized. I gather (from this SO question and this Apple documentation page) that this is a class not available in 10.7.x. It therefore makes sense why the code won't compile on my Lion machine.
My question is, I guess, why I am able to run the downloaded package of TeXShop on 10.7 at all? (According to the website, this version is for OSX 10.7 and up.) I am interested in making a few minor changes to this project; am I not able to check my changes/compile unless I'm using a Mountain Lion machine? Is there some kind of update I can download for coding/compiling purposes?
Assuming you are using Xcode 4.6.*, you should be able to set your project to use the 10.8 SDK and get past the compile errors. (That's the "Base SDK" build setting.)
When i ran my iOS 6 Project on an older xCode using iOS 5.0. It issues warning and fire exception on executing project.
Property 'window' requires method 'window' to be defined - use #synthesize , #dynamic or provide a method implementation
what is the science behind it ? why do i need to explicitly add #synthesize in 5.0. while it works fine in iOS 6.
This has nothing to do with iOS 6 or iOS 5. This has to do with the version of the compiler used in Xcode. The latest versions of the compiler, used in the latest version of Xcode, support many new features not found in older versions of the Objective-C compiler. One of those features is no longer needing an explicit #synthesize statement. Once you take advantage of these newer features, you can't use an older version of the compiler to compile your code.
So now the question becomes - why are you trying to build this project in an older version of Xcode? What is your goal? Why not use the latest Xcode and simply change the project's Deployment Target to iOS 5.0 and leave the Base SDK as "latest".
i have installed the latest iphone sdk 3.0 beta 5, and trying to submit the first application build from this sdk,but when i upload to itunes connect, it give me the message "The binary you uploaded was invalid. The value provided for the key MinimumOSVersion is not acceptable." and cannot be uploaded. therefore i edit my info.plist file in the project and set this key to 2.2.1,like
<key>MinimumOSVersion</key>
<string>2.2.1</string>
and upload again but it still return the same message,have anybody met the same issues and how to get rid of this?
You SHOULD NOT specify MinimumOSVersion in your Info.plist. From the Information Property List Key reference:
MinimumOSVersion (String - iPhone OS, Mac OS X). When you build an iPhone application, Xcode notes the target OS (as determined by the Base SDK selection) as the MinimumOSVersion property. Do not specify this property yourself in the Info.plist file; it is a system-written property. When you publish your application to the App Store, the store indicates the iPhone OS release on which your application can run based on this property. It is equivalent to the LSMinimumSystemVersion property on Mac OS X.
What you need to do is change the Deployment Target setting in your project. The Deployment Target specifies the minimum OS you would like your application to run on. This is regardless of the SDK you build against, which should always be the most recent SDK so you can ensure your application runs correctly on the most recent OS version available. So, in short:
Set the Base SDK to be the latest OS available
Set the Deployment Target to be the earliest OS you'd like your app to run on.
Manually editing the Info.plist file is really just fooling the App Store into thinking your app can run on an OS it isn't built to run on, which could yield unpredictable results.
Please read the notice in the iPhone developer centre. You CANNOT use the iPhone 3.0 SDK to build apps for the App Store at the moment, not even if you compile them for the 2.x OS. You have to compile an app using the 2.x SDK to submit it to the App Store.
You can install both sets of developer tools side by side. When you get to the screen where you select which parts of the package you want to install, you can select an alternative destination for the install.
I had the same problem. Heres how to fix it!
My project was called SuperTennis, so I clicked the project in xcode, and clicked Get Info. Under the General tab, change "Base SDK for all iPhone configurations" to iPhone OS 2.0, then go into the build tab, and change "Base SDK" to "iPhone OS 2.0", then build it for your device. Reveal the app in finder, and then continue on, to upload it. Email me at ryan2925 at gmail.com if you want some more help. I hope this works for you, and anyone else reading.
I got this error when I finally upgraded things from 2.2.1 to the 4.0 SDK, and tried to use an existing project.
I had to:
Click on the project in XCode, then click on Info.
Click 'Build'
Pay attention to what 'Configuration' you are setting. Are you accidentally setting distribution when you are trying to debug?
Set 'Base SDK' to the highest possible.
Change 'Target Device Family' to whatever it is you are doing.
Set 'iPhone OS Deployment Target' to your device's OS (you can check by going to Window > Organizer).
My main time sink was setting my distribution settings when trying to debug and not realizing it.
Try this:
ARMV6: before iPhone 3GS
ARMV7: including and after iPhone 3GS
"Proj." and "Target(s)" right-click, Get Info. Select:-
Base SDK: iPhone 4.0 (latest s greatest)
Standard: ARMV6, ARMV7
Uncheck build for Active Architecture
Deployment Target: 4.0 (not older ones 3.1.3; you don't have the SDK if you upgrade to 4.0)
Compiler section: Ensure that both ARMV6 and ARMV7 checkboxes are ticked under Generate Code, Thumb section.
The binary output is slightly bigger as it is generic code that supports both architectures.
If you want to support ARMV7 only, don't check ARMV6 in compiler section, selection code optimised for ARMV7, check active architecture only. In info.plist, add armv7 in UIRequiredDeviceCapabilities items. This field already exists in info.plist and probably has other system requirements auto-specified.
Right click on your project and go to your build tab. Near the top of the list you can specify your Base SDK. This is the minimum you will compile against. After this your build settings drop down will have the older versions. When you go to make your distribution make sure you aren't using 3.0 cause that will cause your binary to get rejected (as you found out).