update 1
update 1
update 0
.
update 0
This fine question and answer does not quite deal with my Universal app which had both a iPhone and iPad xibs and now wants to use a storyboard.
This is the xib based BSAppDelegate.m (before storyboard)
#import "BSAppDelegate.h"
#import "BSViewController.h"
@implementation BSAppDelegate
NSString *receivedData;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// return YES;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[BSViewController alloc] initWithNibName:@"BSViewController_iPhone" bundle:nil];
} else {
self.viewController = [[BSViewController alloc] initWithNibName:@"BSViewController_iPad" bundle:nil];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
I have tried to insert the following code right after the else
above but I cannot quite complete the code fix which needs to set self.viewController
to be compatible with the above code.
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"BSViewController"];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:NULL];
Can you show me how to fix my code, please? I am using Xcode 4.5.2 and developing for iOS 6.