【问题标题】:file viewController.swift is part of module "coreData" ignoring import文件 viewController.swift 是模块“coreData”的一部分,忽略导入
【发布时间】:2017-06-01 13:44:12
【问题描述】:

我尝试导入 CoreData,但出现警告“文件 viewController.swift 是模块“coreData”的一部分,忽略导入” A Screen Shot

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.
    }


}

【问题讨论】:

  • 是您的项目名称与“Coredata”相关的内容。 ?
  • CoreData 的数据库名称与项目名称相同时会出现此问题。

标签: ios swift xcode core-data


【解决方案1】:

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

【讨论】:

  • 有没有办法在不重命名项目/目标的情况下解决这个问题?
  • 最好重命名您的项目...因为苹果不会重命名框架:)
  • 为我工作!谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-02-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-24
  • 1970-01-01
相关资源
最近更新 更多