iPhone Simulator versions below 6.0 no longer appear in Xcode 4.5 scheme drop down - objective-c

Newbie questions. While learning Objective-C using Xcode 4.5.3 and the book Programming In Objective-C 4th edition, I have reached the final chapter in which two iPhone apps are built. Before building the apps I downloaded iOS simulators 4.1, 5.0 and 5.1.
When I built the first simple iphone app I was able to select iphone 5.0 simulator in the scheme. When I built the second, more complex app I tried to change the scheme which had defaulted to iPhone 6.0 simulator back to iphone 5.0 simulator only to find that that no simulator below 6.0 is available in the drop down any longer.
Having shrugged my shoulders and allowed the launch of my app in the 6.0 simulator I found that one row of the buttons do not display properly in the simulator. This row appears on top of another row with their labels blank or '-'. The xib for this project was created entirely visually according to the book's instructions as I do not yet know how to programatically code the user interface.
I have two questions:
How do I test this app in the iPhone 5 simulator if this scheme is no longer available in the scheme menu;
Why does the iphone 6.0 simulator fail to resemble the xib?

First of all, be sure that you have the Simulator downloaded for 5.0 and 5.1, for this, go to "Xcode -> Preferences -> Downloads", and you will see it there.
If you have them, the next step is to check that your project is deployed in those versions. For this, go to your project properties (click in the project in the project navigator) and check the Property "iOS Deployment Target" in the Info tab.
Next step, in the same screen click in your target and check the tab "Build Settings", and check the property "Base SDK" to see which iOS version you have there.
Let me know how it goes!

This is in answer to my second question:
Why does the iphone 6.0 simulator fail to resemble the xib?
Autolayout. Once this option is unticked, display is as expected.

Related

How to test my app on ios 7 using Xcode 6 simulator

I'm trying to test my app with ios7 using Xcode 6's simulator but I can't find the option to change it. Currently it only loads ios8 while my deployment target is set to 7.
Also according to this message from Apple:
Starting February 1, 2015, new iOS apps uploaded to the App Store must include 64-bit support and be built with the iOS 8 SDK, included in Xcode 6 or later. To enable 64-bit in your project, we recommend using the default Xcode build setting of “Standard architectures” to build a single binary with both 32-bit and 64-bit code.
Does this mean that new apps cannot run on ios7 anymore?
Thank you for your help.
First, Change Deployment Target to 7.You can change Deployment target from target under Deployment Info.
Go to Xcode Preferences, Select Downloads tab and download iOS7 Simulator.
Now go to Xcode, you can find iOS7 Simulator on target device list, if not than quit and restart Xcode.
Hope it will help.
The deployment target is the minimum version of iOS that your application will be expected to run on. It effects how your app is BUILT and not where you run it. You need to choose an iOS 7 device from the run destinations menu and then do a Build&Run to build, install, and run the app on the iOS 7 device.
If you don't have an iOS 7 simulator device in the run destinations menu, go download the iOS 7 runtime from Xcode -> Preferences -> Downloads
Yes you can, go to xcode(7) preferences>select Components here you can download Simulater and Documents also.

Xcode 6.1 can't find 'debug view hierarchy' button

My Xcode version is 6.1. I can find 'debug view hierarchy' button in a new created project, but not with my old project(and the menu item 'capture view hierarchy are always grayed out).
My old project is 32-bit only mac project(not ios) with no arc. my code written mixed with objective-c and c++.
Anyone knows why my old project can't use view debugger?
Doesn't work on iOS 7. It only works with iOS 8+ simulator.
In Xcode 6.2, it is not in the Debug Area, it is in a Debug Navigator:
Then, select View UI Hierarchy:
I find it doesn't work on 32-bit Mac App Project
already answered it here:
https://stackoverflow.com/a/29327564/1194441
And the text:
By adding support for 64bit (arm64) in your target, View Debugging is enabled for 64bit devices (iPhone 5s, iPhone 6 and iPhone 6 Plus)
In your target build settings make sure under Architectures that standard architectures is checked $(ARCHS_STANDARD), and under Valid Architectures you have arm64.
Click to run your project then you can see the button Debug view hierarchy in the Debug Area. The relate document Here

Library not loaded

I added Social.framework in my application in the same way i use to add the other frame works. I have downloaded xcode 4.5 and iOS 6 . but my application crashes with follwing error only on device. It works fine on simulator.
dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
Referenced from: /var/mobile/Applications/FC88291D-2052-45D6-A7BB-65CE340F07BF/Uploading Image.app/Uploading Image
Reason: image not found
I was getting this exact error. My app currently has a deployment target of 5.1. I wanted to add Facebook sharing. I found this old post, Conditionally including a library for different iOS SDK versions?. All I did was set "Social.framework" to 'optional' and it did the trick, then my app would run on ios 5.1 and ios 6.0. Of course you need to do checks at runtime for what OS the device is running otherwise you could run into a crash if you try to access social.framework in ios 5.1 or earlier. Hope that helps!
In Xcode go to targets, Go to build phase and search for Social frame work you will find that under "Link Binary with Libraries" section. There select social frame work and see there is an option on right hand side required/optional in that just change required to optional. Now you are able to run on all ios devices without any crashes.

Support of iPhone 3G

I have submitted one iPhone app 6 times, and in the requirement of the last/ current version, iPhone 3G is not supported anymore.
My question: Why do I lose this model?
I have some remarks:
Now, apps don't support the iPhone 3G anymore.
I made some searches, and I didn't find any news about it.
Before I submitted this version, I updated my XCode from version 4.0.2 (iOS SDK 4.3) to version 4.2 (iOS SDK 5).
Maybe during the submission, "Apple" checked the binary in order to check the version of my tools (which I built my app with).
And as the iOS 5 cannot be installed on iPhone 3G, I have lost this support.
I own an iPhone 3G in order to make compatibility tests.
And with XCode 4.2, I had trouble to debug my App with my iPhone 3G.
But, i found the solution: Add the architecture armv6 is not enough I need to put some weak links.
If I submit my app with these options "special 3G", will these options be take into account and the support will be back?
(see the edit)
"What's new" is I changed my Apple Account: I submitted my app with another account.
Maybe there are some options somewhere that I didn't see.
Edit: I forget a part maybe important: the version of iOS.
The minimum version of iOS for running my app is iOS 3.1.
And my iPhone 3G runs on iOS 3.X
And all troubles I had with XCode 4.2 and my iPhone 3G seem to be the version of iOS (3.X).
Maybe my app lost the support of iPhone 3G to be sure there is no problem with iOS SDK 5 and iOS 3.X
But, there are users with an iPhone 3GS running on iOS 3.X.
I made some tests with one iPhone 3GS running on iOS 4.0: I had no issues and no options to add in my project settings.
Thanks for your answer. The problem may be the version of my XCode.
Like I said, I have already added the architecture armv6. But with my iPhone 3G iOS 3.X, this is not enough.
Did you test only this setting with one iPhone 3G with success?
I should do:
Add the architecture arm6
Set the Base SDK with "Latest iOS" (iOS 5.0)
Set the iOS Deployment Target with the minimum value
--- It's what you advice ----
Remove into the info.plist the parameter "Required device capabilities" (armv6 and armv7)
Add SystemConfiguration.framework as Optional (to make a weak link)
With this settings, my app crashes: "dyld: Symbol not found: __NSConcreteGlobalBlock"
So I should also add in the flag "Other Linker Flags", - weak_library /usr/lib/libSystem.B.dylib
This is one of my questions:
If I submit my app with these options "special 3G", will these options be take into account and the support will be back?
By default, Xcode 4.2 does not include support for the iPhone 3G, but you can add it back. Just select your app target and select "Build Settings". At the top, change the Architectures listed from "Standard (armv7)" to "Other". In the pop-up box, select the existing option and click the minus button, then click the plus button and add "armv7", then again click plus and add "armv6". armv7 will support the newer chips, while armv6 will add back in support for the iPhone 3G... providing you set your iOS Deployment Target to iOS 4.2 or earlier... your setting at 3.x should be just fine—that merely limits you to not using newer features of iOS obviously.
You may also need to add "-mno-thumb" under "Other C Flags" in the Build Settings, though if my memory serves me correctly that may only have been if you are wanting to use Automatic Reference Counting on the old architecture—and even then only because this is a work-around for a known bug.

Interface builder is unable to open documents of type iPad XIB

I got a application from my teammate, and it is for both iphone and ipad devices (which it is developed under iPhone SDK 3.2).
I have iPhone SDK 3.1.3 installed in my mac book. When i tried to compile the application for iphone simulator i got the following error.
Interface builder is unable to open documents of type iPad XIB.
The above error is for interface builder created for ipad.
My Question is we can't compile the application on iPhone SDK 3.1.3 which the application developed under iPhone SDK 3.2?
Please shed some light of this?
thanks
mindus
Go to your project settings, and delete the line that says Interface Builder Plugin search path or something similar.
the exact line in project.pbxproj is: IBC_PLUGIN_SEARCH_PATHS = "${PROJECT_DIR}/**";
Short answer
Temporarily remove the iPad xib when working with the 3.1.3 SDK. Put them back when you go back to 3.2 and above.
Longer answer
This cropped up for me when compiling against 3.1.3. You can use conditional compiling to get code user newer features to build successfully (see Matt Gallagher's helpful post on conditional compiling).
There may be a smarter way to tell the compiler not to look at the iPad xibs. For testing on the 3.1.3 simulator I simply made a copy all my iPad xibs and then removed them from the xcode project. When going back to my current development set up, you have to put them back. It's a bit of pain, but not that fiddly.
To fix this:
Press Command-1 to go to the project tree
Select your project
The in the right panel select your project, and then click on "Build Settings"
In search field just below the "Build Settings" enter: "Overriding Plug-In"
Now, the only visible setting left should say "Overriding Plug-In and Framework Directory"
Double-click the value and remove all entries using "-" button
Click somewhere else so settings are saved
That should fix it