我已经创建了创建对象的函数,但我不知道如何确保每个对象都执行该函数
-(id) init{
if (self = [super init]){
_die = [[NSMutableArray alloc] init];
}
return self;
}
-(void) addDice:(Die *)d{
[_die addObject:d];
}
-(void) roll{
for (int i=0; i<_die; i++) //this is the part i don't get how to do'
{
Die *d = _die[i];
[d roll];
};
}