更新 1
更新 1
更新 0
.
更新 0
この素晴らしい質問と回答は、iPhone と iPad の両方の xib を持っていて、ストーリーボードを使用したいという私の Universal アプリにはまったく対応していません。
これは、xib ベースの BSAppDelegate.m (ストーリーボードの前) です。
#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;
}
上記の直後に次のコードを挿入しようとしましたが、上記のコードと互換性があるようelse
に設定する必要があるコード修正を完全に完了できません。self.viewController
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"BSViewController"];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:NULL];
私のコードを修正する方法を教えてください。Xcode 4.5.2 を使用し、iOS 6 向けに開発しています。