Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jordan72

macrumors member
Original poster
Nov 23, 2005
88
0
Objects are automatically added to the auto release pool that is on the top of the stack, like objects that are returned from NSStrings and NSNumber class methods, -numberWithInt and -stringWithString.

I have a situation where I want some objects that are created in a nested pool to be in added only to the outer pool.

I don't want them added to the inner pool, even though I need to create them within in this pool. How do I create objects, but at the same time add them to a pool that is not currently at the top of the stack?
 

Jordan72

macrumors member
Original poster
Nov 23, 2005
88
0
I found the answer to my question, so I'm posting the answer.

I retain the object, so it will last beyond the scope of the inner pool. And, I send an -addObject: message to the outer pool, where the argument is the object I'm adding to the pool.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.