自定义展开Segue不起作用

时间:2014-09-30 20:43:27

标签: ios objective-c iphone segue unwind-segue

所以我基本上要做的就是有一个自定义的展开segue。我是iOS开发的新手,我还没有在课堂上教过这个。我采取主动并自己研究这个。我的知识受Objective C语言本身的限制。

我一直在主ViewController.m中多次获得未声明的标识符错误,我希望我的所有页面都能使用自定义segue(从右到左的segue和从左到右滑动)展开。

代码(ViewController.m):

    #import "ViewController.h"


@interface ViewController ()

@end

@implementation ViewController


-(IBAction)unwindToMainViewController:(UIStoryboardSegue *)segue
{



}


- (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier {

    //The two line of code below are the ones giving me the error I mentioned above
    CustomUnwindSegue *segue = [[CustomUnwindSegue alloc] initWithIdentifier:identifier source:fromViewController destination:toViewController];

    //These two below are also giving me the same error
    segue.targetPoint = self.segueButton.center;
    return segue;
}

- (BOOL)canPerformUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender {

    return [self respondsToSelector:action];
}

- (void)viewDidLoad
{
    [super viewDidLoad];


}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

0 个答案:

没有答案