I saw a class (inherits from NSOperation class) with .h and .m files as usual, but in the implementation section there is -(void) main method and NSAutoReleasePool object, it looks like the main method of the application itself, why there should be a method with this name in a .m file ?
I saw a class (inherits from NSOperation class) with .h and .m files as
Share
It is just a method on
NSOperation. The difference is:Is a C function which is where the program starts
Is an objective-C instance method on a class.
The reason it has it’s own auto releasepool is that it is generally called on a separate thread therefore this new thread needs to deal with auto released objects.