[NSArray arrayWithObjects:…]
returns an autoreleased object,
and your program does not provide an autorelease pool. (This used to cause runtime
warnings in older releases of iOS/OS X.)
If you use
NSArray* objects = [[NSArray alloc] initWithObjects:round1, round2, nil];
or add an autorelease pool:
int main(int argc, const char * argv[])
{
@autoreleasepool {
LCDRound* round1 = [[LCDRound alloc] init];
LCDRound* round2 = [[LCDRound alloc] init];
NSArray* objects = [NSArray arrayWithObjects:round1, round2, nil];
for (LCDRound* shape in objects) {
[shape paint];
}
}
return 0;
}
then you will see your dealloc
again.