我有2个xcode项目,我想将它们合并为1.但我坚持代表,因为两个项目都有自己的代表。 第一个项目有一个Splitview(主/细节)视图,第二个项目是一个轮播。
我想用carousel项目替换详细视图。我已经链接了框架和相关文件和笔尖。
但是我坚持使用MasterDetail的appdelegate,我如何调用appdelegate和旋转木马项目的ViewController并将所选项目传递给旋转木马?
#import "iPadAppDelegate.h"
#import "MasterViewController.h"
#import "DetailViewController.h"
//iCarousel
#import "CarouselExampleAppDelegate.h"
#import "CarouselExampleViewController.h"
//
@implementation iPadAppDelegate
@synthesize window, splitViewController, masterViewController, detailViewController;
//iCarousel
@synthesize carouselExampleViewController;
//
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
/*
detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil];
masterViewController.detailViewController = detailViewController;
*/
**//iCarousel
??? Call the Carousel delegate? And also the Carousel Controller?
//**
splitViewController = [[UISplitViewController alloc] init];
splitViewController.viewControllers = [NSArray arrayWithObjects:navigationController, detailViewController, nil];
splitViewController.delegate = detailViewController;
// Add the split view controller's view to the window and display.
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;
}
谢谢,
凯文