简体   繁体   中英

Can't Run New Main File Xcode

I have just started learning C programming and using Xcode 4.6.2. When I create a new target for my Xcode project, everything works but Xcode only runs the original target's main class. How can I run my new target's main class?

If you have a second, separate source code file that contains your " main " function, you can set it's "target membership" by using the "file inspector" (which appears along the right side of the Xcode window).

It looks like this:

您可以通过这种方式设置目标会员

The idea here is that you'll have one " main " function in one file for your first target, and a separate " main " function in another file for your second target.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM