CommonEditorCellModel.m 2.9 KB

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