码迷,mamicode.com
首页 > 其他好文 > 详细

从TableviewCell中获得TableviewController的几种方式

时间:2016-04-11 14:17:14      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:


id view = [self superview]; // 获取cell所在的tableview while (view && [view isKindOfClass:[UITableView class]] == NO) { view = [view superview]; } UITableView *tableView = (UITableView *)view; // 获取tableview的控制器 DTAcountSafeViewController * vc = (DTAcountSafeViewController *)tableView.dataSource;
-(MyView*)initWithController:(CardCreatorViewController*) aController andFrame:(CGRect)aFrame
{
    if (self = [super initWithFrame:aFrame]) 
    {
       controller = aController;
       // more initialisation here
    }

    return self;
}

 

从TableviewCell中获得TableviewController的几种方式

标签:

原文地址:http://www.cnblogs.com/heyode/p/5377934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!