问题标签 [nsentitydescription]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
41 浏览

nspredicate - NSManagedObject、NSManagedObjectContext、NSEntityDescription、NSPredicate、NSPersistentStoreCoordinator 的任务

我是ios领域的新手,从苹果官网阅读与上述课程相关的教程。但我不明白 NSManagedObject、NSManagedObjectContext、NSEntityDescription、NSPredicate 给定类的实际工作是什么。所以请帮助我。谢谢你。

0 投票
0 回答
68 浏览

core-data - Swift4 Core Data如何按日期插入NSOrderedSet?

我有一个核心数据模型,其中一条记录to many与照片实体有关系。该关系被标记为ordered在数据模型中。

下面的代码在最后一个索引处添加了一条新记录。我希望记录按日期排序 - 这意味着我必须在某个特定索引处插入对象

有没有办法让核心数据执行块或某些操作来确定新记录的正确插入索引?还是我必须自己计算?

我担心订单,因为删除照片会迫使需要重新计算所有照片的日期范围。

0 投票
1 回答
342 浏览

ios - NSEntityDescription.entity crashes app (SIGABRT)

The line containing NSEntityDescription.entity is crashing and giving me the error

Thread 1: SIGABRT

I have seen other people ask this question, the recommended answer is to simply delete and remake the entity from scratch. I have done this many times, I have also "cleaned" the code thoroughly, and imported CoreData in both my AppDelegate.swift files and this ViewController file. Does anyone have any advice?

Stack Overflow will not let me embed images yet, but here is the Models.xcdatamodeld file.

EDIT

I've found a solution thanks to finally opening the debugger, the following link's 'best answer' describes and solves this issue: Core data: Failed to load model