Wont rotate with new xCode - iphone

I've got a problem with the latest version of xCode. Whenever i create a new Single view application and I deploy this to my iPhone 3GS, it won't rotate the app (to landscape). When I deploy the exact same version to my iPhone 4, it does rotate the app (to landscape). I've tried installing other apps on the 3GS, and those apps rotate just fine. Also older apps that we've developed are rotating just fine on the 3GS.
I just select create new project in xCode and directly deploy it to the test phones (without any code modifications, just changed the iOS deployment target to 5.0 and the Deployment target too (to 5.0)).
The iPhone 3GS runs version 5.1.1, the iPhone 4 runs on 6.0.1. My xCode version is 4.5
Has anybody experienced this problem before, and knows how to fix it?

Do you mean that you changed the Base SDK to iOS 6.0? I've had the same issue when I did just that. In iOS 6, auto rotation has changed and method shouldAutorotateToInterfaceOrientation is deprecated. See this post for details about this change: shouldAutorotateToInterfaceOrientation not being called in iOS 6

Related

How to switch from Xcode 4.1 to 4.5 for iOS 6.0

I just moved from Xcode 4.1 to 4.5 in order to supporting IOS version 6.0.
I modified launch image as 640x1136 pixels and Base SDK is iOS 6.0.
The problem is when I launch the app it throws SIGABRT on main.m and I added exception breakpoint to get more information but It gave breakpoint 1.1 on the same line of the implementation.
However I have noticed that I got a new warning with Xcode 4.5. Warning and Code are written below. Thanks for help.
Warning:
Semantic Issue: 'CountrySettingsViewController' may not respond to 'initWithTitle'
Code:
CountrySettingViewController *countrySettingView = [[[CountrySettingViewController alloc] initWithTitle:NSLocalizedString(#"selectCountry",#"Select the country title")]retain];
I'm not yet ready to jump to xcode 4.5. - because, then a lot of old projects will have to be recompiled e.t.c.
In order to support iphone 5 display, I simply made everything autoresizing, extra checking for iphone 5 display (to set corresponding image), and added iPhone 5 splash screen image. Compiling from 4.4.1, and on iPhone 5 it will look ok.
I then copy installed application from 5.1. simulator to 6.0 simulator, and launch 6.0 simulator, to check how it will look on iPhone 5 (while I don't yet have any iPhone 5 to test).
Hope that helps.
(I have 4.4.1. sdk and 4.5. sdk installed)
But about that error -
is this "initWithTitle" function declared in .h file also? Or else other classes will not see it (even if it works).
Finally, I sorted out my problem from the following answer in link:
iPhone with iOS 6 and Xcode 4.2 issue

Is it possible to build an app for iPhone 5 screen size with the former SDK (iOS5)?

The latest SDK (Xcode 4.5) doesn't support armv6 and I need to support it right now, so I don't want to upgrade Xcode. Can I support iPhone 5 screen size and make an app in non letterbox mode on iPhone 5 from the previous Xcode (4.3.2)?
[edit] Comment by Brad Larson, change it all : Apple is now explicitly rejecting applications submitted with the iOS 5.x SDK and iPhone 5 default images, saying "Your app contains a launch image with a size modifier that is only supported for apps built with the iOS 6.0 SDK or later."
You can build an app that is compatible with iPhone 5 screen size by adding the 640x1136 Default-568h#2x.png in your resources (if the splash screen defined in your Info.plist is Default.png).
Xcode below 4.5 will let you test on iOS6 devices which is a new for Apple as when iOS5 arrived, all previous version of Xcode where not compatible with iOS5 (impossible to test on iOS5 devices).
So, YES you can develop for iOS6 and iPhone5 screen size from Xcode 4.4 or 4.3.

change iphone project to work in both iphone and ipad

I already have an application which i have built for iphone only. I need to change it to work in both iphone and ipad.the upgrade to ipad application option in project tab of xcode is faded.. which I means I cant do that... I tried to run the project in ipad simulator but it gets automatically run in iphone simulator.
What are the proper steps to change my project to work in iphone and ipad.
Initially change the build setting,ie change the Targeted Device Family field to iPhone/iPad. To write logic for iPad use "UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad" this condition.

how can I run a iPad project on a iPhone or touch

I build a iPad project,i want to run the project on iPhone with auto-resize and it's run successful on iPhone 4.1 simulator,but it's always alert 'can only installed on ipads' when i run it with my iPhone,how can I run a iPad project on a iPhone or touch,what can i do?
You should set Targeted Device Family to iPhone/iPad in your project settings.Hope it works for you..
It doesnt make sense to install an iPad app in iPhone at all.
iPad has its own UI controls.You can install iPhone apps to iPad is just because iPad supports all the controls that iPhone has.
Reverse is not possible.

Setting Xcode's target to iPhone NOT iPad

I just upgraded to iPhone SDK 3.2 Beta 4. Since doing so, I have not been able to get the app to launch in the iPhone simulator - it keeps launching in the iPad simulator. I have tried option-clicking the drop-down menu in the top left-corner of Xcode and setting 'Active Executable' to iPhone simulator 3.1.3 but it keeps going back to iPad simulator instead.
What gives? I have no interest in my app running on the iPad and I don't want to test it in the 2X mode in the simulator.
Thanks,
You can't really launch an iPhone app in 3.2.x - sometimes it will pop up - but basically right now it is only for iPad development.
Update for release version of Simulator.
First of all, the title of this question doesn't match the description: Xcode target isn't the same as the simulator hardware device.
If you are writing an app targeting 3.2, it can run on both iPad (using OS 3.2) and lower OS versions on the iPhone. You do this by setting the Base SDK to iPhone Device 3.2, the Targeted Device Family to iPhone/iPad, and the iPhone OS Deployment Target to 3.1 (lower than 3.2).
The iPhone simulator has a menu option for Hardware->Device, which can be set to iPhone or iPad. However, you can only run a 3.2 SDK target in iPad mode, and a Universal app that supports iPad can only use the 3.2 SDK to build.
You can of course set the simulator to iPhone mode and launch your app from Springboard, but that will lose the debugger connection. Switching mode during installation of your app will cause it to crash.
So the short answer is still the same: you can't run a Universal iPad app in the iPhone mode simulator while debugging.
Upper-left corner of the IDE find a dropdown list of Simulator versions - flipped to 3.2 - try to put it back to 3.1.3
and relaunch your app.
This was driving me nuts too, but the answer is right here:
http://quatermain.tumblr.com/post/517122761/running-universal-ipad-iphone-apps-in-the-simulator
In short, tell Xcode to Build for the 3.2 SDK, then switch the build menu to the 3.1 SDK and tell Xcode to Run the app. Presto, the app starts in the iPhone simulator!
From Apple's documentation: "iPhone OS 3.2 does not support iPhone and iPod touch devices. It runs only on iPad." There's no way to target 3.2 for iPhone, so there's no Simulator. Ergo, you'll have to wait for iOS 4. Fortunately, that's only 4 days away now... of course it won't support the first generation of iPhone devices, but for all other iPhone users it's a free upgrade. Not sure about iPod Touches.
You should be able to change your target platform in your Project Settings.
Changing the target platform and device makes no difference. It always launches the iPad simulator.
If you switch the simulator to iPhone mode, the app just disappears.
This dev environment is a mess.
Short answer: You can change the hardware setting in the simulator. Hardware->Device
Go to Project
Set Active Executable
There are 2 options: Ipad Simulator 3.2 or Iphone Simulator 4.0.
If you choose the Iphone simulator, then it will launch Iphone simulator.
If you choose the Ipad simulator, then it will launch Ipad simulator.
I finally solved this problem myself.
First, install new version of xCode, which is xCode 4.
Then set project scheme to iphone simulator and run app in xCode several times.
And re-install xCode 3 and the problem will be gone away!