Xcode8 1 创建coreData的ManagedObject后,报错 linker command failed with exit code 1
Xcode8 1 创建coreData的ManagedObject后,报错
使用Xcode 8.1 创建coreData的ManagedObject后,报错。 duplicate symbol OBJC_CLASS$_ClassName in: .../ClassName+CoreDataClass.o duplicate symbol OBJC_METACLASS$_ClassName in: .../ClassName+CoreDataClass.o ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 解决方法为,将
然后修改ClassName+CoreDataClass.h和ClassName+CoreDataClass.m为ClassName.h和ClassName.m。 注意在ClassName+CoreDataProperties.h中系统给你创建的引用也要记得修改。 备注:下面为三种Codegen的区别,来自XCode 8 generates broken NSManagedObject subclasses for iOS 10 Option 1: "Class Definition" Think of this as the "plug and play" option Use the model editor to create the entities and associated attributes that you want Core Data to manage. Do not use the NSMangagedObject subclass generator. The required files are automatically generated for you by Xcode (however they do not show up in your project navigator). If you do generate the NSManagedObject files, Apple tells you that these files should not be edited in the header comments of said files. If you do need to edit these files, then this is good sign that you need to use another Codegen option. Leave the default Class options for your entity (Module = Global Namespace and Codegen = Class Definition) If you need to override methods of the NSManagedObject, you can create an extension using the Name under the Class option. // Optional extension in Entity.swiftextension Entity { // Override NSManagedObject methods }
Options 2: "Manual/None" Similar to Option 1, except that you can see and edit the NSManagedObject subclass files. Use the model editor to create the entities and associated attributes that you want Core Data to manage. Before using the NSManagedObject subclass generator, set the Codgen option to "Manual/None" for the entity. The Module option should be Global Namespace. After you add/remove/update an attribute, you have two choices: (1) Manually update the NSManagedObject files that were generated for you OR (2) Use the NSManagedObject subclass generator again (this will only update the Entity+CoreDataProperties.swift file). Again, if you need to override and methods from NSManagedObject, you can create an extension. The extension should be created in the Entity+CoreDataClass.swift file and not the Entity+CoreDataProperties.swift file (this file could be updated due to model editor changes). // Optional extension in Entity+CoreDataClass.swiftextension Entity { // Override NSManagedObject methods }
Option 3: "Category/Extension" Use this option if you have custom properties that do not need to be managed by Core Data. Use the model editor to create the entities and associated attributes that you want Core Data to manage. Ensure the Module option is set to Current Product Module and the Codegen option is set to "Category/Extension". Create your own NSManagedObject subclass with the properties that you will self manage. Do not use the NSMangagedObject subclass generator. The required files are automatically generated for you by Xcode (however they do not show up in your project navigator). // Subclass NSManagedObject in Entity.swiftclass Entity: NSManagedObject { // Self managed properties } // Optional extension in Entity.swiftextension Entity { // Override NSManagedObject methods }
Xcode8 1 创建coreData的ManagedObject后,报错 linker command failed with exit code 1的更多相关文章
- iOS 报错: linker command failed with exit code 1 (use -v to see invocation) 原因
在iOS开发中,很多人会遇到这样的报错 linker command failed with exit code 1 (use -v to see invocation) 可能的原因如下: 1.引用出 ...
- HandyJSON.Metadata.Class Xcode10.2, swift5.0 报错 linker command failed with exit code 1
https://blog.csdn.net/weiwandaixu_/article/details/88842491 2019年03月27日 13:35:40 一如初夏丿 阅读数:31 标签: li ...
- [问题]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一
今天添加了一个新类(包括m,h,xib文件),还没有调用,-编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...
- iOS报错:linker command failed with exit code 1 (use -v to see invocation) 问题解决方式之一
百度库原版本:3.2.1 更新为:4.2.0,两个库相隔2年时间: 问题i: 更新CocoaPods的同时更新了百度地图库的版本,运行程序报错: linker command failed with ...
- [报错]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一
今天添加了一个新类(包括m,h,xib文件),还没有调用,—编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...
- iOS开发——打包报错error: linker command failed with exit code 1
真机运行没问题,打包报错: clang: error: linker command failed with exit code 1 (use -v to see invocation) 原因:在Xc ...
- Xcode真机报错clang: error: linker command failed with exit code 1 (use -v to see invocation)
出现这种错误,如下图所示,搜索bitcode,置为NO即可.
- mac M1通过homebrew安装python3报错Error: Command failed with exit 128: git
fatal: not in a git directoryError: Command failed with exit 128: git 只需要运行 git config --global --ad ...
- pycharm报错:Process finished with exit code -1073741819 (0xC0000005)解决办法
这个是几个月前的问题了,有小伙伴在CSDN问我咋解决的,那我今天在这边把这个问题解决办法分享下吧,免得大家把很多时间都浪费在安装排坑上面,有些坑虽然解决了还真不知道啥原因. 我的pycharm一直用的 ...
随机推荐
- JVM参数详细说明
JVM参数详细说明 答: 下面红色部分是常用参数 -XX:CMSInitiatingPermOccupancyFraction:当永久区占用率达到这一百分比时,启动CMS回收-XX:CMSInit ...
- OpenStack Heat模板内部函数
Heat模板内部函数又称为Intrinsic functions. 注:Intrinsic functions只能用在 resource 的 properties 段 和 outputs 中. ...
- Apache2.4的三种模式
prefork 多进程模式 一个主进程,负责生成多个子进程,也称工作进程,进程之间独立,每个进程之间只能有一个线程,优点是稳定,缺点是内存占用大,每个进程响应一个用户请求. worker 多线程模式 ...
- 【Leetcode_easy】804. Unique Morse Code Words
problem 804. Unique Morse Code Words solution1: class Solution { public: int uniqueMorseRepresentati ...
- 【CUDA开发】CUDA编程接口(一)------一十八般武器
子曰:工欲善其事,必先利其器.我们要把显卡作为通用并行处理器来做并行算法处理,就得知道CUDA给我提供了什么样的接口,就得了解CUDA作为通用高性能计算平台上的一十八般武器.(如果你想自己开发驱动,自 ...
- 【VS开发】TCP服务端如何判断客户端断开连接
原文出自:http://www.cnblogs.com/youxin/p/4056041.html 一篇文章: 最近在做一个服务器端程序,C/S结构.功能方面比较简单就是client端与serve ...
- 51.Qt-使用ajax获取ashx接口的post数据
由于当前C++项目需要使用ajax库去post调用ashx接口,接口地址如下所示: 需要传递的参数如下: 然后发现qml比较好调用ajax.js库,所以本章通过C++界面去获取qml方法来实现调用as ...
- 冲刺Noip2017模拟赛8 解题报告——五十岚芒果酱
1.鼎纹 [问题描述] 据说鼎纹的 种制造 式是 铜模印出来的,这是我国古代劳动 智慧 的结晶.铜模印过的地 ,会留下深深的印记,经过时间的炼化,洗 练成历史的遗存. 聪明的古代劳动人民拥有一个 a ...
- 彻底理解JavaScript中的prototype、__proto__
虽然在JavaScript里一切皆对象,但为了理解原型链系统,我们需要将JavaScript的对象分为对象和函数两大类.在此基础上,JavaScript的原型链逻辑遵从以下通用规则: 对象有__pro ...
- Java面试题代码篇
1.统计字符串中的各种字符的个数并对其排序 package JavaMianSiTest; public class TongJIZiFu { public static void main(Stri ...