运用button写的一个关灯游戏
声明了一个属性NSMutableArray *arr;
_arr = [[NSMutableArray alloc] init];
创建10行8列的button矩阵
for (int i =0; i < 10; i++) {
for (int j =0; j < 8; j++) {
UIButton *button = [UIButtonbuttonWithType:UIButtonTypeSystem];
button.frame =CGRectMake(27.5 + j *40, 20 + i *40, 35, 35);
给button添加背景图片
[button setBackgroundImage:[UIImage