核心数据 - 如何生成CoreDataGeneratedAccessors? [英] Core Data - how to generate CoreDataGeneratedAccessors?
问题描述
我已经浏览了苹果开发网站,google和堆栈溢出来找出CoreDataGeneratedAccessors背后的基础知识。
I've gone through apple dev website, google and stack overflow to figure out the basics behind CoreDataGeneratedAccessors.
我正在使用Xcode 4.2和核心数据。我正确地创建了实体及其关系,包括逆。
I'm using Xcode 4.2 and core data. I created entities and their relationships properly including inverse.
以下代码失败:
self.remdetail = [NSEntityDescription insertNewObjectForEntityForName:@"RemDetail" inManagedObjectContext:context];
[rem addRemDetailObject:remdetail]; --> I'm trying to add rem detail to rem object
因为没有自动生成的访问方法,我将以下代码手动放在NSManagedObject子类之一中。当我为我的实体创建NSManagedObjects时,未生成以下代码。我尝试通过浏览一些文章和建议自动生成访问器,如Xcode copy&粘贴等但没有生成以下代码。
because there are no accessor methods generated automatically, I put the following code manually in one of the NSManagedObject subclass. The following code was not generated when i created NSManagedObjects for my entities. I tried to generate accessors automatically by going through few articles and suggestions like Xcode copy & paste etc but nothing is generating the following code.
in rem ManagedObject - >
in rem ManagedObject -->
@interface Rem (CoreDataGeneratedAccessors)
- (void)addRemDetailObject:(RemDetail *)value;
- (void)removeRemDetailObject:(RemDetail *)value;
- (void)addRemDetail:(RemDetail *)value;
- (void)removeRemDetail:(RemDetail *)value;
@end
有谁知道如何生成CoreDataGeneratedAccessors?
does anyone know how to generate CoreDataGeneratedAccessors?
谢谢,
Rama
Thanks, Rama
推荐答案
你检查了开关To-Many Relationship 在关系属性中?
Have you checked the switch "To-Many Relationship" in the relationship properties?
这篇关于核心数据 - 如何生成CoreDataGeneratedAccessors?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!