1,@property (nonatomic,readwrite)NSInteger score;注意这里有一个只读和只写的属性,readonly.
2,重写初始化方法也可以改名字和传参数,(改名一般以initWith开头),
-(instancetype) initWithCardCount:(NSUImteger)count usingDeck:(Deck *) deck;
3,输出控件数组。
@property (strong,nonatomic)IBOutletCollection(UIButton)NSArray *cardButtons;
方法里面可以用for(UIButton* cardButton in self.cardButtons 来控制控件。
4,操作数组基本函数,- (void)addObject:(id)anObject;
- (void)insertObject:(id)anObject atIndex:(int)index;
- (void)removeObjectAtIndex:(int)index; Usually created with [[NSMutableArray alloc] init]