by setpatchaddress · 6y ago · 0 comments
- the standard library design -- every object is refcounted and any code that references the object can add it to an autorelease pool, so you can't safely predict when dealloc will be invoked
- Objective C doesn't support stack-based objects
@autoreleasepool {
RaiObj* obj = [RaiObj new];
[obj autorelease];
//... stuff
}
will de-allocate at the end of the block if nothing else hold onto it, but it's obviously less neat.