splitViewController with Two NavigationController linking protocols

ⅰ亾dé卋堺 提交于 2019-11-29 05:18:10
Dhawal

Ok, I know am very late for answer but this answer is, I think, perfect and working. Try it. Open your RootViewController.h, on the top write this line:

#import "Left.h"
#import "Right.h"

in @interface RootViewController write this lines

Left *lefty;
Right *righty;

after that declare property as,

@property (nonatomic, retain) Left *lefty;
@property (nonatomic, retain) Right *righty;

go to ROOTVIEWCONTROLLER.M file synthesize as,

@synthesize lefty;
@synthesize righty;

after that in RootViewController.m just replace your function with this one

    - (IBAction)myBtnPushed{
    NSLog(@"myBtnPushed");


    lefty = [[Left alloc] initWithNibName:@"Left" bundle:[NSBundle mainBundle]];
    righty = [[Right alloc] initWithNibName:@"Right" bundle:[NSBundle mainBundle]];

    lefty.delegate=righty;
    [self.navigationController pushViewController:lefty animated:YES];

    [detailViewController.navigationController pushViewController:righty animated:YES];


}

in delloac write this,

[lefty release];
lefty = nil;
[righty release];
righty = nil;

It's done, run your app. I tested, it's done.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!