CommonEditorCellModel.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //
  2. // OrderInfoRModelCell.m
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 14-7-12.
  6. // Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "CommonEditorCellModel.h"
  9. #import "RAUtils.h"
  10. #import "BundleModelViewController.h"
  11. @implementation CommonEditorCellModel
  12. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  13. {
  14. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  15. if (self) {
  16. // Initialization code
  17. }
  18. return self;
  19. }
  20. - (void)awakeFromNib
  21. {
  22. // Initialization code
  23. // [self addGestureRecognizer: [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longTap:)]];
  24. }
  25. - (IBAction)onClickBundle:(UIButton *)sender {
  26. UIViewController* vc=[RAUtils getViewController :sender];
  27. BundleModelViewController * bundleVC =[ vc.storyboard instantiateViewControllerWithIdentifier:@"BundleModelViewController"];
  28. bundleVC.content_data = self.bundle_item;
  29. UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:bundleVC] ;
  30. navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
  31. [vc presentViewController:navi animated:YES completion:^{
  32. // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
  33. NSLog(@"bundle present.........");
  34. // self.btop = false;
  35. // <#code#>
  36. }];
  37. }
  38. /*
  39. -(void)longTap:(UILongPressGestureRecognizer *)longRecognizer
  40. {
  41. if (longRecognizer.state==UIGestureRecognizerStateBegan) {
  42. [self becomeFirstResponder];
  43. UIMenuController *menu=[UIMenuController sharedMenuController];
  44. UIMenuItem *copyItem = [[UIMenuItem alloc] initWithTitle:@"复制" action:@selector(copyItemClicked:)];
  45. UIMenuItem *resendItem = [[UIMenuItem alloc] initWithTitle:@"转发" action:@selector(resendItemClicked:)];
  46. [menu setMenuItems:[NSArray arrayWithObjects:copyItem,resendItem,nil]];
  47. [menu setTargetRect:self.bounds inView:self];
  48. [menu setMenuVisible:YES animated:YES];
  49. }
  50. }
  51. #pragma mark 处理action事件
  52. -(BOOL)canPerformAction:(SEL)action withSender:(id)sender{
  53. if(action ==@selector(copyItemClicked:)){
  54. return YES;
  55. }else if (action==@selector(resendItemClicked:)){
  56. return YES;
  57. }
  58. return [super canPerformAction:action withSender:sender];
  59. }
  60. #pragma mark 实现成为第一响应者方法
  61. -(BOOL)canBecomeFirstResponder{
  62. return YES;
  63. }
  64. #pragma mark method
  65. -(void)resendItemClicked:(id)sender{
  66. NSLog(@"转发");
  67. //通知代理
  68. }
  69. -(void)copyItemClicked:(id)sender{
  70. NSLog(@"复制");
  71. // 通知代理
  72. }*/
  73. - (void)setSelected:(BOOL)selected animated:(BOOL)animated
  74. {
  75. [super setSelected:selected animated:animated];
  76. // Configure the view for the selected state
  77. }
  78. @end