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一直用的 ...
随机推荐
- 一百四十二:CMS系统之帖子详情页面布局
定义一个404页面 <!DOCTYPE html><html lang="en"><head> <meta charset="U ...
- 123457123457#0#-----com.yuming.YiZhiFanPai01--前拼后广--益智早教游戏记忆翻牌cym
com.yuming.YiZhiFanPai01--前拼后广--益智早教游戏记忆翻牌cym
- Spring Cloud(7.2):配置Producer Server
我们首先创建一个生产者服务.这里以一个商品价格服务为例,这个微服务可以对商品-价格信息进行增删改查,当有商品-价格信息被更新或删除,则该微服务发送消息,告诉其他调用它的系统这条信息已经被修改. 配置p ...
- 【Leetcode_easy】1122. Relative Sort Array
problem 1122. Relative Sort Array 参考 1. Leetcode_easy_1122. Relative Sort Array; 2. helloacm; 完
- iOS-MJRefresh框架
1.用MJRefresh框架实现上下拉刷新 1.1 如何使用这个框架,只需要告诉控件的scrollView是谁,就能将框架添加到我们的滚动视图中了 // 下拉刷新 MJRefreshHeaderVie ...
- python从hello world开始 - python基础入门(3)
万丈高楼平地起,编程亦如此.改变世界是结果,坚持努力学习改bug是过程,hello world是开始,所有语言均是如此. 一.使用pycharm创建第一个hello world 项目 1.Create ...
- 乐字节Java构造器(构造方法|构造函数)、方法与内存分析
一. 构造器(构造方法|构造函数) 在创建对象时(new),必会调用一个特殊的方法,这个方法是初始化对象信息的为new服务的.这个方法称为“构造器” 使用 new + 构造方法创建一个新的对象. 构造 ...
- 乐字节Java编程之方法、调用、重载、递归
一.概述 方法是指人们在实践过程中为达到一定目的和效果所采取的办法.手段和解决方案. 所谓方法,就是解决一类问题的代码的有序组合,是一个功能模块.编程语言中的方法是组合在一起来执行操作语句的集合.例如 ...
- error PRJ0003 : 生成“rc.exe”时出错
完美解决 visual studio 2008运行时 error PRJ0003 : 生成“rc.exe”时出错 步骤如下 : 1.运行vs2008安装程序,点击安装或删除程序.在“选择要安装的功能” ...
- PowerShell->>获取本地计算机的用户组和组成员
获取本地计算机的用户组和组成员 function Get-LocalGroups() { net localgroup | ?{ $_ -match "^\*.*" } | %{ ...