我有一个使用coredata的项目,该项目最初是用Xcode6编写的。当我修改实体并重新生成文件时,我得到2个新文件,最后有+ coredataproperties。我刚刚在表中添加了一个新实体,但是当我尝试引用它时,我在代码中得到一个错误,说明对象剂量存在,即使我在运行时调试托管对象时我可以在返回列表中看到该对象。
for(Products *product in Data){
//set deleted to true
product.awaitingDelete = [NSNumber numberWithBool:TRUE];
product.awaitingUpload = [NSNumber numberWithBool:TRUE];
}
Product.awaitingDelete给我们一个错误,说它在产品对象上找不到。
在.h文件中,它看起来像这样..
#import "Products+CoreDataProperties.h"
@implementation Products (CoreDataProperties)
@dynamic awaitingDelete;
@dynamic awaitingUpload;
@dynamic jobID;
@dynamic orderNumber;
@dynamic productGUID;
@dynamic productID;
@dynamic productNotes;
@dynamic roomName;
@dynamic toBeDeleted;
@dynamic windowGUID;
@dynamic windowID;
@dynamic windowName;
@dynamic windowNumber;
@dynamic windowType;
@dynamic containsAnswers;
@dynamic inWindow;
@end
当我运行代码并调试产品对象时,我可以看到实体
印刷产品说明:(实体: 产品; id:0xd000000000b00058 ; 数据:{ awaitingDelete = nil; awaitingUpload = nil; containsAnswers =( " 0xd0000000056c0046", " 0xd000000005600046", " 0xd000000005700046", " 0xd000000005680046", " 0xd000000005580046", " 0xd0000000054c0046", " 0xd000000005540046", " 0xd0000000055c0046", " 0xd000000005500046", " 0xd000000005640046" ); inWindow =" 0xd00000000048005c&#34 ;; jobID = 122; orderNumber = 0; productGUID =" B281A604-26D0-4CD6-A2A6-AAF6EB0B2846&#34 ;; productID = 262; productNotes = nil; roomName =大师; toBeDeleted = nil; windowGUID =" 8738FC28-9206-4935-9DC4-7E52030A77DC&#34 ;; windowID = 186; windowName = 01; windowNumber = 2; windowType =标准; })
我猜我错过了xcode7的内容,有人可以帮忙吗?