application launch is taking 5-6 seconds on iOS 6.X.X versions in iPads. This works well on iOS 5.X. The default.png file remains a little longer on the screen with iOS 6.X.X.What could be wrong with loading.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIInterfaceOrientation orientation=[[UIApplication sharedApplication] statusBarOrientation];
if (orientation==UIInterfaceOrientationLandscapeLeft || orientation==UIInterfaceOrientationLandscapeRight)
{ self.viewController=[[EBHomeViewController alloc] initWithNibName:#"EBHomeViewController-LA" bundle:nil] ;
}
else if(orientation==UIInterfaceOrientationPortrait || orientation==UIInterfaceOrientationPortraitUpsideDown)
{
self.viewController=[[EBHomeViewController alloc] initWithNibName:#"EBHomeViewController-PT" bundle:nil] ;
}
navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = navController;
[self.window makeKeyAndVisible];
there is no heavy code in applicationDidFinishLaunching.It takes time when we install the app & open it for first time /restarting iPad & launching application.
Related
I'm creating an app without Storyboard on XCode 6.4 and when I run the app, no matter which simulator I use, I always get a (320,480) screen.
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *vc = [[UIViewController alloc] init];
vc.view.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = vc;
[self.window makeKeyAndVisible];
return YES;
}
Ref img: http://i.stack.imgur.com/hGHmt.png
Already tryed:
vc.view.autoresizingMask =
UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
What should I do to make it fill the whole screen?
I had the same problem, You should set launch image of your app about default-568#2x.png with 640 x 1136 pixel size.
More info --> link
Also setting #2x #3x image assest will be good for you.
Add launch screen. It will be solved.
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/chapters/AddingLaunchImagestoanAssetCatalog.html
i am developing app using ios8 support with portrait and Landscape mode both,
but problem is that when i try to rotate my Device to Landscape mode it cant work for me.
i test same thing in my other device iPhone 4 with ios7.1.2 it work fine but not working with ios 8.1 in iphone 4s
please give me suggestion if any one also have the same problem.
ARViewController* metaioCloudPlugin = [[ARViewController alloc] initWithNibName:#"ARViewController" bundle:nil];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = metaioCloudPlugin;
[self.window makeKeyAndVisible];
====
This is my AppDelegate code for main window root view.
Thanks in advance.
i fixed this issue .
Remove below line from code and its work fine now.
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
refer this link
iOS 8 - App not rotating appropriately
I was facing the same issue, while I was updating the xib base project for iOS8,
I found the solution inside your question,
thanks for asking :)
self.window.rootViewController = loginScreen;
While navigating to the screen
loginScreen = [[LoginScreen alloc] initWithNibName:#"LoginScreen" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:loginScreen];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = loginScreen;
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
I've a project that runs perfectly (I hope :)) on ios 6 SDK.
When I try to test it on ios 5 simulator, I've a blank view so I suppose that I've used some uncompatible methods.
How Can I discover and verify which methods doesn't works?
Or are there some problems with my xib?
EDIT:
My appDelegate code:
LoginViewController *loginViewController =
[[LoginViewController alloc] initWithNibName:"LoginViewController.xib" bundle:[NSBundle mainBundle]];
navigationController = [[UINavigationController alloc] initWithRootViewController:loginViewController];
navigationController.navigationBar.hidden = YES;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = navigationController;
if (![self connect]){}
[self.window makeKeyAndVisible];
"Apple and backward compatibility" is an oxymoron. It is not interesting to Apple if you publish apps that use older than the current iOS version, you know how hard they force developers and consumers to move on. I wouldn't bother and I would set the bottom line at 6.
My app works fine with iOS 5.1 on both iPad and iPhone. In iOS 6 app works fine on iPad but crashes in iPhone while setting the window.rootViewController = navigationViewController. I have set Exception break point which stops execution at this piece of code in application didFinishLaunchingWithOptions. I even tried adding it as [window addSubView:navigationViewController.view] but no luck. Has any one faced similar issue.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
rootViewController = [[SpringboardViewController alloc] initWithNibName:#"SpringboardViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootViewController];
self.window.rootViewController = nav;
self.window makeKeyAndVisible];
return YES;
}
could you write an exception ?
take a look at these questions
applications expected to have a root view controller console
Applications are expected to have a root view controller at the end of application launch
Thanks for your replies guys i figured out the problem ,problem was with the application supportedInterfaceOrientationsForWindow where i was returning UIInterfaceOrientationPortrait instead of UIInterfaceOrientationMaskPortrait since app debugger was struck at self.window.rootViewController = nav, i thought problem was with this statement.
Thanks Ravindharan and Ogres.
I am getting started with iOS programming, and created a new project in XCode 4.2.1. However, I do not see .xib file in my project as expected. I tried added a new .xib file and build interface on it, but when I run my program, I see a blank white screen on the iPad Simulator. Am I missing something? Thanks.
You can replace this method in the appDelegate (and the name of the xib / strip out universal aspects of code if needed)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:#"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:#"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
or
choose a Single View Application from the templates you are offered when creating a new app