English 中文(简体)
核心数据库
原标题:Core Data SQLite Constraint Failed

I sometimes get an error when I attempt to save a managed object context backed by SQLite.

Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x280170 {NSFilePath=/var/mobile/Applications/7773BDBD-C502-4E21-9632-FA36A109BF6E/Documents/Social.sqlite, NSUnderlyingException=error during SQL execution : constraint failed}, { NSFilePath = "/var/mobile/Applications/7773BDBD-C502-4E21-9632-FA36A109BF6E/Documents/Social.sqlite";
NSUnderlyingException = "error during SQL execution : constraint failed";  
} 

这不是双向数据库,只有在我修改某个实体并在短时间内多次挽救环境时才会发生。 谁能建议一种办法来阻止这种情况? 我先看一下qlite 案卷,然后看不到什么。 我不认为,这显然违反了核心数据限制(要求价值或其他类似价值),因为我看不出对双亲仓库的错误。 该方案很复杂(几个路面的多面情况),我无法重复简单法典中的错误,在此显示。 关于如何从核心数据背后的泥石灰中砍伐的任何想法?

问题回答

这可能是,这种拯救要么是在人们意识到自己受限制的父母关系(这是我所理解的)。

i.e. 父母记录已经保存到3个方面,然后与主要阅读背景合并,然而,儿童记录已接近5个(或除3个外的任何阅读),而后者已经意识到到3个方面对主要环境的改变。

将这一记录纳入到现在的5个环境中,将违反参考性完整性和关系限制。 在这种情况下,只有可能将记录直接插入主线。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签