合并2个xcode项目

发布于 2024-12-06 20:02:48 字数 1817 浏览 1 评论 0原文

我有 2 个 xcode 项目,我想将它们合并为 1 个。但我坚持使用代表,因为这两个项目都有自己的代表。 第一个项目有一个分割视图(主/详细)视图,第二个项目是轮播。

我想用轮播项目替换详细视图。我已经链接了框架以及相关文件和笔尖。

但我卡在了 MasterDetail 的 appdelegate 上,如何调用 carousel 项目的 appdelegate 和 ViewController 并将所选项目传递给 carousel?

#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;
}

谢谢,

凯文

I have 2 xcode projects and i want to merge them into 1. But i stucked at the Delegates as both project has their own delegates.
First project has a Splitview (Master/Detail) view and the second project is a carousel.

I want to replace the detail view with the carousel project. I already linked the framework and the related files and nibs.

But im stucked at the appdelegate of the MasterDetail, how do i call the appdelegate and the ViewController of the carousel project and pass the selected item to the carousel?

#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;
}

Thanks,

Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文