3 ms·
With a few exceptions, pointers returned by methods in Objective-C are assumed to be autoreleased. That means their reference count will be decremented at the e
by teaspoon 16y ago
With a few exceptions, pointers returned by methods in Objective-C are assumed to be autoreleased. That means their reference count will be decremented at the end of the event loop.
But if OP is expecting a lifetime of learning, he might want to push a new autorelease pool for each iteration.
- mbenjaminsmith 16y agoOr just release it. If you're sure it's autoreleased then retain/release it. If you're not sure, just set it to autorelease before you retain/release it.
- othermaciej 16y agoretain/release on an autoreleased object won't make it get destroyed any faster. You still have to wait for the event loop to cycle (or push/pop your own autorelease pool).
- mbenjaminsmith 15y agoThat's correct. That's something I read, have repeated but never bothered to actually test.