I created an NSOperation. Do I also need to create an autorelease pool for this or is it all handled for me like voodoo black magic?
+2
A:
The NSOperation may run on any thread, so yes, you must set up your own autorelease pool for the work being done.
Mike
2009-12-29 06:08:53
+2
A:
You do need to create autorelease pool yourself in the NSOperation
main method, if the environment doesn't support automatic garbage collection.
notnoop
2009-12-29 06:09:11
Wait... what? Never should the words "autorelease pool" and "automatic garbage collection" appear in the same sentence. The two are completely different. This makes no sense.
bbum
2009-12-29 08:06:55
You just put them in one sentence ;-). When running in the garbage collection mode, you don't need the autorelease pool; and if you aren't running in garbage collection mode, then you need to manage your own memory, possibly by using autorelease pools. What doesn't make sense about this?
notnoop
2009-12-29 14:14:37