view · edit · sidebar · attach · print · history

20130911-research-icloud-syncing

<< | Index | >>


Summary

  • Reseach about iCloud Syncing (Conflict, Restore)
  • Update to save products.plist to iCloud.

Commits / Patches

Index / Status


Resarch about iCloud sync

Today once I tried to use Key-Value Store instead of plist file on iCloud.

Generikacc.app uses plist file as local storage for scanned products.
In iCloud, Maybe In this such a case, it should use Key-Value Store.

It has limit 1024 counts (1024MB). And File-based store is recommended for Off-line.

So I continue with file-based store.

link


Debug creating

Could not update data by Error (Move).

2013-09-11 13:54:22.382 generika[2841:6307] -[ProductManager handleError:userInteractionPermitted:] [Line 307] error #=> The operation couldn’t be completed. (Cocoa error 4.)
2013-09-11 13:54:22.396 generika[2841:60b] -[ProductManager productsPath] [Line 122] plist #=> file:///private/var/mobile/Library/Mobile%20Documents/4B37356EGR~org~oddb~generika/Documents/generika/products.plist
2013-09-11 13:54:22.392 generika[2841:6307] -[ProductManager handleError:userInteractionPermitted:] [Line 308] userInfo #=> {
    NSDestinationFilePath = "/private/var/mobile/Library/Mobile Documents/4B37356EGR~org~oddb~generika/Documents/generika/products.plist";
    NSFilePath = "/private/var/mobile/Applications/6A62B5F2-9D3C-4997-8C26-42DACC092293/tmp/(A Document Being Saved By generika)/products.plist";
    NSSourceFilePathErrorKey = "/private/var/mobile/Applications/6A62B5F2-9D3C-4997-8C26-42DACC092293/tmp/(A Document Being Saved By generika)/products.plist";
    NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
    NSUserStringVariant =     (
        Move
    );
}
2013-09-11 13:54:22.533 generika[2841:60b] __22-[ProductManager save]_block_invoke [Line 169] fileURL #=> file:///private/var/mobile/Library/Mobile%20Documents/4B37356EGR~org~oddb~generika/Documents/generika/products.plist
2013-09-11 13:54:22.541 generika[2841:60b] __22-[ProductManager save]_block_invoke [Line 174] fail !!!!

cocoa error 4 means: NSNotFoundError
(No such file or directory)

link


Source url and destination url

I could not update file on iCloud.
The Problem was URL (FileSystem Structure).
iClound needs sames structure in app.

Keep in mind that the location where you move your file to within the iCloud sandbox must go in pair with your NSMetadataQuery searchScopes. For example, moving a file to your iCloud sandbox’s root directory will not make it visible to the metadata query if you gave it the NSMetadataQueryUbiquitousDocumentsScope scope (spent a whole hour scratching my head on this one).

from http://samvermette.com/312

z.B.

# it fails (it is handled as move, and no such file or directory error is caused)
source #=> .../Application/org.generika/Documents/products.plist
destination #=> .../Mobile\ Docemnts/generika/Documents/generika/products.plist

# works
source #=> .../Application/org.generika/Documents/products.plist
destination #=> .../Mobile\ Docemnts/generika/Documents/products.plist

Generikacc.app has already as Documents/products.plist (without any directory.)

Now could I save product.list data into iCloud.

This is saved plist file in iCloud.
It has $version and $archiver.

Next barcode images.

view · edit · sidebar · attach · print · history
Page last modified on September 11, 2013, at 10:08 AM