Class Block : NSObject
Block *blocks[5]; // or calling malloc()
Block *aBlock = [[Block alloc] init];
blocks[0] = aBlock;
// at this point, aBlock will be hand over to array blocks slot.
// not like NSArray, object of 'Block' will not retain by @property(retain)
// or should I call retain before hand over the value into its array and release afterward?
// should I still call below code to release object ?
// [aBlock release];
答案 0 :(得分:2)
否,因为原始数组不会保留每个Block
对象。因此,如果您释放它,则在函数退出范围时将清除所有Block
个对象