orientation is not getting fix ipad 6? - iphone

Hi I have developed an application in ios 4, now I am building it on ios 6 but the orientation is not working. I am using splitview for iPad.

I had the same issue before.
I fixed it by setting the rootview controller of window as UISplitView.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self.window setRootViewController:viewController];
}
Where UISplitViewController *viewController;

check my answers on this link my friend.
Device orientation handling in iOS 6 during view load?
if you are not getting then do tell me..
Let me know it is working or not...
Happy Coding!!!

Related

iOS 7 Default image overlapped by status bar in multi-tasking view

My app is compiled against iOS 6 SDK (haven't gotten the time to upgrade to iOS 7 SDK). So I just noticed that the Default image is overlapped by the status bar. This seems to happen only in the "multi-tasking" view but not when resuming my app from background for some reason.
See this image:
I don't think many people will notice this at all.
However, as far as I know you could possibly disable the Statusbar when the app gets in backround.
To do this just use this method in the delegate:
- (void)applicationWillResignActive:(UIApplication *)application {
//code to disable statusbar
}
In the applicationDidBecomeActive method you could enable the statusbar again.
- (void)applicationDidBecomeActive:(UIApplication *)application {
//code to enable the statusbar
}
Furthermore you can take a look at this previous asked question: Status bar won't disappear
If you got any questions feel free to ask!
edgesForExtendedLayout does the trick for iOS 7. However, if you build the app across iOS 7 SDK and deploy it in iOS 6, the navigation bar appears translucent and the views go beneath it. So, to fix it for both iOS 7 as well as for iOS 6 do this:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
if ([self respondsToSelector:#selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone; // iOS 7

IOS 6 view rotation issue [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Autorotate in iOS 6 has strange behaviour
I have issue with IOS 6, the display show up as portrait and not as landscape.
I am using both real and simulator device, if I build the game on 5.1 simulator the view is properly presented if I am using simulator version 6 or the real device with version 6 the view is get portrait view.
Here is my code.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if( interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight )
return YES;
Any idea how to solve such issue?
Thanks
ER
ShouldAutoRotation does not work anymore for iOS 6. Use supportedInterfaceOrientations instead.
You can get more information here: http://dhilipsiva.blogspot.com/2012/07/ios-6-ui-interface-orientation.html
Hope this helps.
The method shouldAutorotateToInterfaceOrientation has been deprecated for iOS 6. It has been replaced with the following:
- (BOOL)shouldAutoRotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
Also, there's a VERY important detail to make this work. In your AppDelegate, make sure you change the following:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self.window setRootViewController:<your main view controller here>];
}
If you're using [self.window addSubview:self.mainViewController.view], it won't work.
If you want to support iOS 5 as well as iOS 6, leave shouldAutorotateToInterfaceOrientation in your code; just know that it won't be called on iOS6 devices.
The example #Simon gave should be able to coexist peacefully with your original code, with either operating system calling its applicable method. I was able to implement something similar in my app, but I used the project settings to set up autorotation for iOS 6 and just left my shouldAutorotateToInterfaceOrientation alone to make the app compatible with iOS 5 too.

XIB loads in iOS 4 but doesn't load in iOS 5

I created an app in Xcode 4.1 and now i upgraded it to 4.2 so i could use the iPhone 5 simulator.
I have an app that uses a tab bar to loads 3 views. They load correctly in iPhone 4 but in iPhone 5 simulator that doesn´t happen. I´m able to see my xib (with no content) that i load initially, but there are no tabs to choose from.
Apple made some changes in the projects in Xcode 4.2. Now they have storyboards which i don´t have because i created the app in Xcode 4.1. Anyone knows a work-around this?
The only code i think it may be usefull..
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[window addSubview:montraViewController.view];
[self.window makeKeyAndVisible];
return YES;
}
I was loading the view in viewDidAppear, that method was triggered when the view appeared in iOS 4 but in iOS 5 that didn´t happen. So i changed my "load controls" to the method viewDidLoad and they loaded correctly. Don´t take this has a bug, because it´s more probable to be bad programing.

rootViewController set in Storyboard not showing on App Launch

I started with an Empty Application and added the storyboard file myself, added a View Controller to the storyboard and then embedded it into the Navigation Controller. Now, when I launch the app in iOS Simulator - nothing shows. Screenshot of my storyboard is below.
What needs to happen to get the "AddPerson" to show on launch?
Update: Yes, Main Storyboard is set, but the Main Interface is blank. Should that Main Interface be set to something(the drop down is blank)?
Just comment out all your generated code in app delegate's - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method except for return YES.
Here's my code and it worked fine.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
//self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
return YES;
}
I searched and searched, and finally found my answer(#jms - hope this answers yours as well). See here: Xcode 4.2 iOS Empty Application and storyboards.
I had the same problem, just select both of them CMD+X to cut, then CMD+V to paste it will set one as root view :)

App shows white screen on startup after upgrading to iOS 4.2

For the past few weeks I have been working on an app that uses a SoundManager class that I found via the comments of this blog post:
http://www.gehacktes.net/2009/03/iphone-programming-part-6-multiple-sounds-with-openal/
The link to the SoundManager and tester app is provided in the comments by David Evans. I am not allowed to provide a second link so I'll mention the name of ZIP file he links to:
SoundTester.zip
I was very happy with this code, until iOS 4.2 was released. After updating my iPad and Xcode correspondingly, my apps that use the SoundManager class only show the navigation bar with it's title. The rest of the screen is white. It's not iPad specific behavior. I have seen the same on an iPhone4 and an iPhone 3G that upgraded to iOS 4.2.
When running the apps in the simulator, I get the same results. The problem is that I get no error messages in the console window and no build and compile errors at all. Very frustrating and very hard to fix for an iPhone developer that started using the iPhone SDK only months ago.
Does anyone have a clue what could have gone broken and how to fix it? Any help is appreciated!
Somebody please shoot me...
Just found the problem, with the help from a piece of code I had written down from the iPhone Developer's Cookbook.
The problem was not the SoundManager (which still works fine, fortunately!) but in the application:didFinishLaunchingWithOptions: method in the App Delegate class.
Here is the code that causes the problem in iOS 4.2 but still works in iOS 3.2:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Create a Navigation Controller on the fly.
// Use the View Controller as root view controller.
viewController.title = #"ThreeSounds";
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
nav.navigationBar.barStyle = UIBarStyleBlack;
// Add the view controller's view to the window and display.
[window addSubview:nav.view];
[nav release];
[window makeKeyAndVisible];
return YES;
}
The solution: remove the line that says: [nav release].
For some reason, releasing the navigation controller was not a problem in iOS 3.2.
In iOS 4.2 is makes the screen go white.
I found out that this method was the problem because it was the last method that was executed. That, in turn, I found out by adding this piece of code to every class in my project:
-(BOOL) respondsToSelector:(SEL)aSelector {
printf("SELECTOR: %s\n", [NSStringFromSelector(aSelector) UTF8String]);
return [super respondsToSelector:aSelector];
}
This piece of code logs all the methods that get called.
I used the following code in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if (!window)
{
[self release];
return 0;
}
This method caused white screen when I launched my app. It was OK in 3.2 / 4.0 SDK. In SDK 4.3 it is causing the problem. Just comment or remove this code if you have it.
I had same problem. The problem was duplicated UIWindow.