【问题标题】:Application crashes while creating persistent store when switching icloud account切换 icloud 帐户时创建持久存储时应用程序崩溃
【发布时间】:2013-03-06 06:08:38
【问题描述】:

我正在应用程序的核心数据中实现 iCloud。 但问题是,当我在添加持久存储时切换 iCloud 帐户应用程序崩溃。以下是我得到的错误日志

Error: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x1cd3c600 {NSFilePath=/private/var/mobile/Library/Mobile Documents/E7E99FZSXM~com~tpt~mobileinventorynavigator/data/.baseline/com.tpt.mobilecommoditytrader.store200hij/R374GT_SOtlsru2c6ZdIu7SJvDIGqlBCc9juS0aP_0k=/baseline.zip, NSUnderlyingError=0x1cd3d000 "The operation couldn’t be completed. Bad file descriptor"}
" UserInfo=0x1cd3d850 {NSLocalizedDescription=<PFUbiquityBaseline: 0x1cd3e4d0>(0)
    permanentLocation: <PFUbiquityLocation: 0x1cd3e320>: /private/var/mobile/Library/Mobile Documents/E7E99FZSXM~com~tpt~mobileinventorynavigator/data/.baseline/com.tpt.mobilecommoditytrader.store200hij/R374GT_SOtlsru2c6ZdIu7SJvDIGqlBCc9juS0aP_0k=/baseline.zip
    safeLocation: <PFUbiquityLocation: 0x1cd3da20>: /private/var/mobile/Library/Mobile Documents/E7E99FZSXM~com~tpt~mobileinventorynavigator/data/.baseline/com.tpt.mobilecommoditytrader.store200hij/R374GT_SOtlsru2c6ZdIu7SJvDIGqlBCc9juS0aP_0k=/mobile.CE450AC2-AB0D-5B69-BA2F-280ACE4DC4F5
    currentLocation: <PFUbiquityLocation: 0x1cd3e320>: /private/var/mobile/Library/Mobile Documents/E7E99FZSXM~com~tpt~mobileinventorynavigator/data/.baseline/com.tpt.mobilecommoditytrader.store200hij/R374GT_SOtlsru2c6ZdIu7SJvDIGqlBCc9juS0aP_0k=/baseline.zip

    storeName: com.tpt.mobilecommoditytrader.store200hij
    modelVersionHash: R374GT_SOtlsru2c6ZdIu7SJvDIGqlBCc9juS0aP_0k=
    baselineArchiveLocation: <PFUbiquityLocation: 0x1cd3e320>: /private/var/mobile/Library/Mobile Documents/E7E99FZSXM~com~tpt~mobileinventorynavigator/data/.baseline/com.tpt.mobilecommoditytrader.store200hij/R374GT_SOtlsru2c6ZdIu7SJvDIGqlBCc9juS0aP_0k=/baseline.zip

我还在拦截 iCloud 帐户更改并删除存储文件并创建新文件。但我没有成功。请建议您是否知道我在做什么错

【问题讨论】:

  • 您是将 Core Data 存储文件放在 ubiquity 容器中(相对于 URLForUbiquityContainerIdentifier: 的某个位置)还是应用程序沙箱中(例如在 Documents 目录中)?

标签: iphone ios objective-c icloud


【解决方案1】:

首先查看天气你有没有登录过icloud账号,下面的代码

 NSURL *ubiq = [[NSFileManager defaultManager]
                       URLForUbiquityContainerIdentifier:nil];

if(ubip== nil)  
     NSLOG(no icloud acount);  
else  
     NSLOG(icloud acount); 

【讨论】:

  • 我的问题不在于删除并重新登录到同一个帐户!但我的问题是在一台设备上切换多个帐户
猜你喜欢
  • 1970-01-01
  • 2011-12-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多