'UIApplicationMain'属性不能在包含顶级代码的模块中使用 [英] 'UIApplicationMain' attribute cannot be used in a module that contains top-level code

查看:306
本文介绍了'UIApplicationMain'属性不能在包含顶级代码的模块中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有突然的错误,我的AppDelegate中出现此错误:

All of a suden I got this error in my AppDelegate:

'UIApplicationMain'属性不能在具有以下功能的模块中使用: 包含顶级代码

'UIApplicationMain' attribute cannot be used in a module that contains top-level code

在其表示以下内容的行中:@UIApplicationMain

in the line where it says: @UIApplicationMain

现在该项目无法构建.我正在使用Swift和Xcode 6.2.我尝试删除派生的数据文件夹,甚至使用了我最初创建项目的最新Xcode 6.3 beta.

Now the project cannot build. I am using Swift and Xcode 6.2. I have tried deleting the derived data folder and even using the latest Xcode 6.3 beta, which was where I first created the project.

我不知道发生了什么,我到处搜寻都没有运气. 谢谢

I don't know what's going on and I have searched everywhere with no luck. Thank you

推荐答案

好,我终于自己解决了.我添加的库中似乎还藏有另一个文件,名为main.swift,它与我的AppDelegate冲突.我删除了它,问题就消失了.

Ok, I finally solved it myself. It seems there was another file buried within a library I added called main.swift which was conflicting with my AppDelegate. I deleted it and the issue went away.

这篇关于'UIApplicationMain'属性不能在包含顶级代码的模块中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆