十一岁的加重songxing10000…… ------ 回到博主首页

点击cell弹出一个日期选择器

- (void)setUpGroup2
{
    ILGroupItem *group = [[ILGroupItem alloc] init];
    // 结束时间
    ILSettingItem *endTime = [ILSettingItem itemWithImage:nil title:@"结束时间"];
    endTime.subTitle = @"23:59";
    // __unsafe_unretained __weak
    // __weak会把指针自动清空 p = nil ,能防止野指针错误
    // typeof(self) // 获取类型
    __unsafe_unretained typeof(self) scoreVc = self;

    endTime.option = ^(NSIndexPath *indexPath){
        
        
        UITableViewCell *selCell = [scoreVc.tableView cellForRowAtIndexPath:indexPath];
        
        UITextField *textField = [[UITextField alloc] init];
        
        [textField becomeFirstResponder];
        textField.inputView = [[UIDatePicker alloc] init];
        
        // iOS8会自动做键盘处理,前提是把textField加入到对应cell
        [selCell addSubview:textField];
        
    };
    group.items = @[endTime];
    
    [self.groups addObject:group];
}

  

posted @ 2015-05-25 00:51  songxing10000  阅读(530)  评论(0编辑  收藏  举报