iOS 6 Simulator - objective-c

I downloaded the xcode for iOS6 along with the simulator. Now, when I run my cocos2d project, the screen doesnt follow along with the device turns. It always stays in the "up" position, when it used to always stay in the "right" position. Does anyone know how to fix this?

iOS 6 introduces a new mechanism for nominating supported interface orientations; see 'Handling View Rotations' in the UIViewController documentation.
The short version is that unless you implement -supportedInterfaceOrientations on your view controller to further limit the options then whatever orientations you specified as supported in your Info.plist will be used.
So quite probably you want to click on your project in the top left hand corner of the Xcode project navigator, select your target in the left-hand bar of the content on the right, then 'Summary' in there and ensure you have only the landscape right orientation selected.
E.g.

Related

segmented control in navigation bar broke with latest Xcode 9.2

I have an app with a segmented control in the navigation bar as a navigation item that when I build with Xcode 9.2 is broken. Doesn't respond to touches in two of the segments and it is not positioned correctly anymore (should appear centered in the nav bar) Nothing has changed in the project. I.e. I build the same version that is approved in the app store.
Any ideas what may have changed with Xcode that could be causing this? I'm targeting 9.1 so it isn't anything to do with iOS 11. When I go into story board the segmented control isn't appearing inside the View anymore it is off by itself in a blank part of the story board (see second image below).
Update: If I remove all constraints for the segmented control then it appears in the correct location but I still can't see or select it in storyboard.

Is there a different way to view the iOS Simulator in Xcode 5 / Am I viewing my button correctly?

So I'm doing the Ray Wenderlich tutorials on iOS, and I'm doing the button tutorial. When I run the app, I get something that looks like this:
I have two questions:
I often see simulators show up in the form of an actual iPhone and was wondering if that was possible, or if that rectangle is the only way to view it?
The reason I'm asking is when I connected the button to an action (It says 'Pressed!'). So, is it supposed to show up in the box (bottom right) only, or should it should up on the simulator itself- mimicking what the user would see on-screen?
Regarding your first question: Probably a problem with screen size. See also here How can I restore the iPad frame around iOS Simulator 5.1?
The output seen in the screenshot is produced with NSLog and won't be seen on the device. You need to add an UILabel or such and set its text.
In the Simulator menu, try selecting Window then Scale and go to 50%. The retina models are far too big on my screen. Also, the old iOS 6 simulator with standard iPhone did look like a real phone, so examples from a while ago will look different.
If you want to support iOS 6.x, you can load it into Xcode. From Xcode main menu, select Xcode and then Preferences, and go to the Downloads tab.

How to position static buttons and iPhone 5

I am working on an app where i have 12 buttons and labels underneath on one of the views. They are placed on the storyboard directly. I want to make sure they will get properly repositioned in iPhone 5. The solution that i tried is just to deselect all the lines in the autosizing for all the buttons. Now when i try it on iphone 5 the buttons get resized. The problem if i stretch the storyboard and move the buttons they get messed up when running on the smaller screen. So i can only position them on the smaller screen and then it seems to work. The app does not rotate. I would like to know if this is a good solution or there is a better solution for this case. I would like for the app to support iOS 5+
Thank you!
If you want layouts to work with varying screen sizes, you should become familiar with the new constraint-based layout scheme in iOS 6. A WWDC video on the subject can be viewed at http://www.youtube.com/watch?v=Dkr9eKxlMAk&feature=player_detailpage.
Essentially, you're going to use the old struts and springs system for pre-iOS 5 and conditionally use the new scheme for iOS 6. (iPhone 5 won't run any iOS version prior to 6.)

how to change mainwindow.xib's orientation to landscape? [duplicate]

I appreciate I'm probably missing something basic here, but...
My iPad app will only support landscape mode, and has a MainWindow.xib Window that I'd like to work on in landscape mode in XCode 4, however the pull-down menu to change this (Simulated Metrics -> Orientation) is always grayed out.
I notice that Views can be rotated just fine, it's only Windows that can't be rotated in XCode 4 using this setting.
Is there a workaround for this, or do I have to put a View on top of the MainWindow in order to rotate it?
I think it's because apps always starts up in portrait and then rotates to appropriate oriantations. From the UIViewController docs:
Note: At launch time, applications should always set up their
interface in a portrait orientation. After the
application:didFinishLaunchingWithOptions: method returns, the
application uses the view controller rotation mechanism described
above to rotate the views to the appropriate orientation prior to
showing the window.
So you'll need the UIViewController magic for the simulated metrics to make any sense. If you used the "Window-based application" template as a starting point for your project try the "View-based application" template instead.

XCode 4: Create iPad Version using autosizing masks

I've just upgraded to XCode 4 Gold and I can't find a way to automatically create the iPad view from an iPhone view (or viceversa).
To be clear, the feature I am looking is the same as in the Interface Builder of XCode 3, there is an option "Create iPhone/iPod touch version using autosizing masks" when you're working on an iPad View, and "Create iPad version using autosizing masks" on iPhone/iPod Touch.
If anybody know if this is possible...
Thanks in advance.
There is still a way to convert xibs to iPad. It is just hard to find:
Select the project in the navigator, then right-click the target and make sure it is set to iPhone -- if set to Universal this process will not work. (You can set it back to universal afterwards)
Right click the target and then select Duplicate.
Choose to Duplicate and Transition to iPad. A group called "Resources-iPad" will be added to your project and will contain the iPad-converted xibs.