Tag: 错误

核心数据-existingObjectWithID:错误:导致错误133000

我的应用程序使用核心数据(有一些魔法logging的帮助),并使用NSOperation相当严重的multithreading。 当然,我非常小心只能在线程/操作之间传递NSManagedObjectID 。 现在,为了回到操作中相应的托pipe对象,我使用-existingObjectWithID:error: : Collection *owner = (Collection *)[localContext existingObjectWithID:self.containerId error:&error]; 但是我回来是零和error说这是一个错误#13300: NSManagedObjectReferentialIntegrityError 。 以下是关于这个错误的文档说明: NSManagedObjectReferentialIntegrityError Error code to denote an attempt to fire a fault pointing to an object that does not exist. The store is accessible, but the object corresponding to the fault cannot be found. 在我的情况下,这是不正确的:这个对象是存在的。 实际上,如果我用NSFetchRequest迭代那个Collection实体的所有实例,我发现它在其中,它的NSManagedObjectID正是我传递给-existingObjectWithID:error: 而且,如果我使用-objectWithID:取而代之,我得到一个正确的对象就好了。 所以有一些我错过了。 以下是一些其他意见/问题: “不存在的客体”:这句话中“存在”的含义是什么? […]

“这个错误的创造者没有指定一个理由”exception

我有WCF服务中的以下代码基于某些情况抛出自定义错误。 我得到一个“这个错误的创造者没有指定一个原因”的例外。 我究竟做错了什么? //source code if(!DidItPass) { InvalidRoutingCodeFault fault = new InvalidRoutingCodeFault("Invalid Routing Code – No Approval Started"); throw new FaultException<InvalidRoutingCodeFault>(fault); } //operation contract [OperationContract] [FaultContract(typeof(InvalidRoutingCodeFault))] bool MyMethod(); //data contract [DataContract(Namespace="http://myuri.org/Simple")] public class InvalidRoutingCodeFault { private string m_ErrorMessage = string.Empty; public InvalidRoutingCodeFault(string message) { this.m_ErrorMessage = message; } [DataMember] public string ErrorMessage { get { […]