入口点(_main)undefined xcode 6

ull*_*trm 15 xcode ios

我不能为我的生活找到解决方案!我正在使用Swift.我突然得到这个错误:

Undefined symbols for architecture i386:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
Run Code Online (Sandbox Code Playgroud)

无论我试图运行什么模拟器/设备,我仍然得到它:

Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
Run Code Online (Sandbox Code Playgroud)

这是什么?!我几乎删除了项目中的所有内容.即所有框架和一切.它还在那里.

请帮我

t1s*_*ser 24

在你的AppDelegate.swift中有这个:

import UIKit
Run Code Online (Sandbox Code Playgroud)

@UIApplicationMain


Tom*_*ton 10

另一个原因(不是为了你,而是为了寻找答案的其他人)AppDelegate.swift是因为某些原因未包含在应用目标中.我不知道为什么会这样 - 我认为这是我的用户错误 - 但没有它你会得到这个错误,原因并不明显.确保在应用目标中选中该文件的复选框.


Tia*_*uto 7

我有同样的问题,但我只是忘了把@UIApplicationMainAppDelegate.swift放在顶部


iHT*_*boy 5

我的问题是:"main.m"被删除了项目.