2012-02-21 217 views
0

我在应用程序的关键阶段得到这一个错误。 这种情况是,MainView使用谓词“User ==%@”currentUser在主视图中获取实体“Category”的列表。iCloud - 核心数据同步问题

此页面通过icloud在设备间同步。

有一个用户< ----->类别< ---- >>字段< --------- >>条目(时间戳,值)。 < < ------------>用户 唯一的区别在于,条目可以属于不同的用户。因此是最后一次关系。

当我做添加一个“入口”的实体,它创造了当地罚款,但是当日志中接收设备到达(通过iCloud的)......我得到这个:

2012-02-21 06:36:55.573 APPCloud[2403:4923] -[_PFUbiquityRecordsImporter operation:failedWithError:](839): CoreData: Ubiquity: Import operation ecountered an error: Error Domain=NSCocoaErrorDomain Code=134060 "The operation couldn’t be completed. (Cocoa error 134060.)" UserInfo=0x79ce410 {exception=Illegal attempt to establish a relationship 'forUser' between objects in different contexts (source = <Entry: 0x855eac0> (entity: Entry; id: 0x855e6b0 <x-coredata:///Entry/tDF69E4F8-35DE-4DC1-8077-F5A563FE0DCC1041> ; data: { comment = nil; 
    forField = nil; 
    forUser = nil; 
    period = 0; 
    timeStamp = nil; 
    value = 0; 
}) , destination = <User: 0x288820> (entity: User; id: 0x232a10 <x-coredata://43C097FE-4A91-42A9-B8EC-CF32D65F7328/User/p1> ; data: { 
    birthday = "1999-02-20 21:00:00 +0000"; 
    entries =  (
     "0x79aa590 <x-coredata:///Entry/tDF69E4F8-35DE-4DC1-8077-F5A563FE0DCC16>", 
     "0x2071d0 <x-coredata://43C097FE-4A91-42A9-B8EC-CF32D65F7328/Entry/p1>", 
     "0x206bf0 <x-coredata://43C097FE-4A91-42A9-B8EC-CF32D65F7328/Entry/p2>" 
    ); 
    firstName = Samuel; 
    fullName = nil; 
    height = 0; 
    images =  (
    ); 
    lastName = User; 
    male = 1; 
    trackers =  (
     "0x797bb60 <x-coredata://43C097FE-4A91-42A9-B8EC-CF32D65F7328/Tracker/p1>" 
    ); 
    uuid = "07110878-F6D3-482D-BC0E-3CE8B4A581E4HGMG"; 
    years = 0; 
}))} while trying to import the log file at the URL: <PFUbiquityTransactionLog: 0x79ca620> 

我用同样的上下文,我不知道这里发生了什么...当这些日志到达时,其他的stuf没有工作..

请指点我正确的方向!

谢谢

回答

0

您是否将此添加到零或属性上下文?尝试不使用本地属性上下文

+0

是的,显然我添加的上下文没有正确初始化。我多么跛脚! – jasonIM 2012-02-21 14:52:06