效果图:
在storyboard的上拖出三个button、两个label加在cell上:如下图
// 创建一个记录数量和状态的model对象
#import <Foundation/Foundation.h>
@interface Custon : NSObject
@property (nonatomic, assign) BOOL isChoose;
@property (nonatomic, assign) NSInteger number;
@end
// TableViewCell.m
#import "TableViewController.h"
#import "TableViewCell.h"
#import "Custon.h"
@interface TableViewController ()
@property (nonatomic, strong) NSMutableArray *custonArr;
@end
@implementation TableViewController
- (void)viewDidLoad {
[super viewDidLoad];
// 数组一定要先初始化,也可以用懒加载
self.custonArr = [NSMutableArray array];
// 自定义数据源
for (int i = 0; i &