In the book I’m reading, it talks about forcing an NSAutoreleasePool to drain. Does this mean creating a local NSAutoreleasePool and then draining it, instead of draining the one that already exists? That is, can I not drain an NSAutoreleasePool twice or multiple times?
In the book I’m reading, it talks about forcing an NSAutoreleasePool to drain. Does
Share
No, you cannot drain an autorelease pool more than once.
Yes. Either make a new pool and drain it, or (even better) use
@autoreleasepool.Correct. The documentation for
drainstates:Since an autorelease pool gets deallocated after the first call to
drain, it is never valid to call any method on it afterwards,drainincluded.