I am working on a simple Objective-C tutorials for some friends and it came to a very simple question I could not answer. In a Foundation Tool project, why is main a method? At least its is called "main-method" in all the books I read.
Let me tell you about the details ... I made a small program where a NSMutableArray is sorted with a function. I put the function before main and it all works fine. My problem is how to explain a beginner why main is a method while the code to sort the array is a function. It's hard to see any difference.
We all know methods always belong to classes while functions do not but in my project I have no classes only the main.m. A C++ guy like me I expected main to be static but it is not.
So the question is "Why is main a method and not a function?" Or is it not? Or is it something completely different?