Xcode: two goals, two main files?

I am working on a game in Xcode, and I want to add a helper application that uses the main application of various classes to create the main application data files.

In particular: The main application is a card game. I want to use a helper application that uses classes such as card.m, while it creates deck.xml files for the deck of custom cards that the game uses.

My intuition is that the natural way to do this is to add a second compilation goal to the Card Adder application to create this XML file. Unlike the main application, which is Cocoa Touch, I can make it one of the Shell applications to make it fast and dirty.

Here is my conversation, and my question: What began as the main procedure for this second goal? Looking back at my existing main.m file, I see that it is associated only with the main game application. So far, so good. But of course, I cannot add a second main.m file for the helper / shell application.

How do I get around this? What am I using instead of main.m? How do I tell the Card Adder compilation signal that this new file will contain the main routine?

+3
source share
2 answers

This is not a file name, but a function name / signature

  int main(int argc, char *argv[])

It is important. Just create a file with this function. You can have only one core for each application.

+3
source

main.m. . , - .

+4

Source: https://habr.com/ru/post/1756251/


All Articles