侧滑菜单

时间:2015-02-19 07:35:38

标签: ios xcode6

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

if ([segue isKindOfClass:[SWRevealViewControllerSegueSetController class]]) {


    SWRevealViewControllerSegueSetController *swSegue = (SWRevealViewControllerSegueSetController*) segue;
    swSegue.performBlock = ^(SWRevealViewControllerSegueSetController* rvc_segue, UIViewController* svc,UIViewController* dvc){

    UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
        [self.revealViewController setFrontViewPosition:FrontViewPositionLeft animated:YES];
    };

}

}

我打电话给我,在点击表视图中的特定单元格时调用我的不同用户界面,但是他们给了我一个错误"在SWRevealViewC ontrollerSegueSetController类型上找不到属性performblock"

请帮忙!!!在此先感谢。

1 个答案:

答案 0 :(得分:1)

是的,我有同样的错误

但是在最后一节的 SWRevealViewController.h 文件中,从此代码中删除评论

@interface SWRevealViewControllerSegue : UIStoryboardSegue     

@property (nonatomic, strong) void(^performBlock)(
     SWRevealViewControllerSegue* segue, UIViewController* svc,
     UIViewController* dvc );

@end

与上一节 SWRevealViewController.m 文件中的相同内容从此代码中删除此评论

@implementation SWRevealViewControllerSegue  // DEPRECATED

-(void)perform {
    if ( _performBlock )
        _performBlock( self, self.sourceViewController,self.destinationViewController ); 
}

@end

我认为这会在你的项目中起作用