xcode 文件 viewController.swift 是忽略导入的模块“coreData”的一部分

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41698087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:43:53  来源:igfitidea点击:

file viewController.swift is part of module "coreData" ignoring import

iosswiftxcodecore-data

提问by Mikael Weiss

I tried to import CoreData and it came up with a warning "file viewController.swift is part of module "coreData" ignoring import" A Screen Shot

我试图导入 CoreData,但它提出了一个警告“文件 viewController.swift 是模块“coreData”的一部分,忽略导入” 屏幕截图

import UIKit
import CoreData

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

回答by BoledgiDev

Is your project name "CoreData" ? You can't call your project with the name of a module. Try creating another project with another name

您的项目名称是“CoreData”吗?您不能使用模块的名称来调用您的项目。尝试使用另一个名称创建另一个项目