开发者

Ipad/iphone..universal app

Hello I am creating universal app for iphone and i pad. I have tabl开发者_Go百科e views and next views ..It is working fine in ipad but i want to add split view for ipad only.. how to do this in same code?


Create split view in MainWindow-iPad.xib and connect win your appdeletegate.

You need to check in appdelegate.h and .m file.

in .h file

UISplitViewController *splitViewController;
SearchViewController *ipad_listViewController;
DetailResultViewController *ipad_detailViewController;

@property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController;
@property (nonatomic, retain) SearchViewController *ipad_listViewController;
@property (nonatomic, retain) DetailResultViewController *ipad_detailViewController;

in .m file

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    // Override point for customization after app launch    
    [self createDatabaseIfNeeded];

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        // Add the split view controller's view to the window and display.
        [window addSubview:splitViewController.view];
        [window makeKeyAndVisible];
    }
    else {
        [window addSubview:[navigationController view]];
        [window makeKeyAndVisible];

    }

    return YES;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜