project_files/HedgewarsMobile/Classes/HoldTableViewCell.m
branchios-revival
changeset 11252 3dc674af7662
parent 11135 b34c0e2b546a
child 12872 00215a7ec5f5
equal deleted inserted replaced
11250:7f3f96e9fdf1 11252:3dc674af7662
    16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
    16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
    17  */
    17  */
    18 
    18 
    19 
    19 
    20 #import "HoldTableViewCell.h"
    20 #import "HoldTableViewCell.h"
    21 
    21 #import "UITableViewCell+FindTable.h"
    22 
    22 
    23 @implementation HoldTableViewCell
    23 @implementation HoldTableViewCell
    24 @synthesize delegate;
    24 @synthesize delegate;
    25 
    25 
    26 #define SWIPE_DRAG_HORIZ_MIN 10
    26 #define SWIPE_DRAG_HORIZ_MIN 10
    64             [self.delegate holdAction:self.textLabel.text onTable:tableView];
    64             [self.delegate holdAction:self.textLabel.text onTable:tableView];
    65         }
    65         }
    66     }
    66     }
    67 }
    67 }
    68 
    68 
    69 - (UITableView *)findTable
       
    70 {
       
    71     UIView *tableView = self.superview;
       
    72     while (![tableView isKindOfClass:[UITableView class]] || (tableView == nil))
       
    73     {
       
    74         tableView = tableView.superview;
       
    75         
       
    76         if ([tableView isEqual:self.window])
       
    77         {
       
    78             tableView = nil;
       
    79         }
       
    80     }
       
    81     
       
    82     return (UITableView *)tableView;
       
    83 }
       
    84 
       
    85 -(void) dealloc {
    69 -(void) dealloc {
    86     self.delegate = nil;
    70     self.delegate = nil;
    87     [super dealloc];
    71     [super dealloc];
    88 }
    72 }
    89 
    73