cell上点击 ,跳转自定义alertview(storyboard上的)

cell上点击 ,跳转自定义alertview(storyboard上的)_第1张图片

#import "xxxxxxxxcontrollert.h"

#import

typedefvoid(^PromiseBlock)(void);

@interfaceSaleM6_BillQueryAlertViewController :UIViewController

/**

 交收商品

 */

@property (weak, nonatomic) IBOutlet UILabel *CommodityID;

/**

 仓库编号

 */

@property (weak, nonatomic) IBOutlet UILabel *houseID;

/**

 交收数量

 */

@property (weak, nonatomic) IBOutlet UILabel *querty;

/**

 确认按钮

 */

@property (weak, nonatomic) IBOutlet UIButton *okButton;

/**

 回调的Block

 */

@property(copy,nonatomic)PromiseBlock promiseBlock;

@end


#import "xxxxxxxx.m"

@interface SaleM6_BillQueryAlertViewController ()

@end

@implementationSaleM6_BillQueryAlertViewController

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

}

- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}

- (IBAction)quiteButtonClick:(id)sender {

    self.promiseBlock();

    [self.view removeFromSuperview];

    [self removeFromParentViewController];


}

- (IBAction)cancelButtonClick:(id)sender {

    [self.view removeFromSuperview];

    [self removeFromParentViewController];

}


xxxxxx.pch

/**

 *  设置NSBundle等bundel信息

 *

 *获取资源路径使用GNNTRESOURCE_PATH(@“资源路径”);

 例如设置imageView有如下两种方法

 //第一种设置图片的用法

 NSString *imgPath= [GNNTBUNDLE_PATH stringByAppendingPathComponent :@"tableviewheader.png"];

 UIImage *image = [[UIImage alloc] initWithContentsOfFile:imgPath];

 [[self imgView] setImage:image];


 //第二种设置图片的用法

 [[self imgView] setImage:[UIImage imageNamed:GNNTRESOURCE_PATH(@"tableviewheader.png")]];

 所有子工程必须有三个target 一个application 一个 static library 一个 bundle

 */

#define PLUGINBUNDLE_NAME @"SaleM6Bundle.bundle"

//#define PLUGINBUNDLE_NAME @ ""

#define GNNTBUNDLE_PATH [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: PLUGINBUNDLE_NAME]

#define GNNTBUNDLE [NSBundle bundleWithPath: GNNTBUNDLE_PATH]

#define GNNTRESOURCE_PATH(path) \

[PLUGINBUNDLE_NAME stringByAppendingPathComponent:(path)]

//获取根rootVC

#define APPLICATIONROOTVIEWCONTROLLER [[[[UIApplication sharedApplication]delegate]window]rootViewController]


xxxx.h//定义自定义按钮(跳转前的按钮)

//注销

- (void)logoutButtonClick:(UIButton*)button{

    _SaleM6_BillLoadingQueryInfo = [_dataArray objectAtIndex:button.tag];

    UIStoryboard *story = [UIStoryboard storyboardWithName:@"SaleM6_BillMian" bundle:GNNTBUNDLE];

    SaleM6_BillQueryAlertViewController *vc = [story instantiateViewControllerWithIdentifier:@"SaleM6_BillQueryAlertViewController"];

    vc.modalPresentationStyle = UIModalPresentationCustom;

    vc.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.4];

    vc.CommodityID.text = _SaleM6_BillLoadingQueryInfo.commodityID;

    vc.houseID.text = _SaleM6_BillLoadingQueryInfo.warehouseID;

    vc.querty.text = _SaleM6_BillLoadingQueryInfo.deliverQuantity;

    [vc.okButton setTitle:GNNTLocalizedString(@"bill_cancel", @"撤销") forState:UIControlStateNormal];

    [APPLICATIONROOTVIEWCONTROLLER.view addSubview:vc.view];

    [APPLICATIONROOTVIEWCONTROLLER addChildViewController:vc];


    vc.promiseBlock= ^(void){

        [self getCancelBillLoadingRegister];

    };

}


你可能感兴趣的:(cell上点击 ,跳转自定义alertview(storyboard上的))