0

After months and months I really am out of ideas now on how I can keep my app's saved data in sync. The app saves its data (fillable certificates) into a table view from core data. The user fills out the relevant details in UITextFields and can save these certificates to the device into a UITableView

The NSMutableArray for the UITableView data is self.certificates

Loading data into table view

- (void)loadData
{

 ICContractorManager *contractorManager = [ICContractorManager manager];
    NSError *error = nil;
    Contractor *contractor = [contractorManager primaryContractor:&error];
    if (contractor == nil || error != nil) {
        DebugLog(@"Failed to fetch contractor");
        if (error != nil) {
            DebugLog(@"Error: %@", error.localizedDescription);
        }
    }
    else {

        NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"modifiedAt" ascending:NO];
        NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
        //Certificate data
        self.certificates = [[contractor.certificates sortedArrayUsingDescriptors:sortDescriptors] mutableCopy];


    }

    [self.tableView reloadData];
    NSLog(@"LOAD CERT DATA %@",contractor.certificates); <-----logs data of certificates ok


}

What im trying to achieve:

  1. To sync the table data between devices
  2. As this seems seems to be eluding me id settle for a least a manual back up and restore option.

What have I tried...For the sake of brevity this is a brief version

  1. The usual research on Google and SO (months not days on and off)
  2. Using nice class called PersistentStack. Imagine my joy when this effortlessly synced my data. This was not to last as duplicates began appearing in other areas of my app that were unwanted.
    It was then I reached out to Apple who told me to come up with my own algorithm to prevent duplicate initially. I explained to them that the reason I was using a TSI was I could use some advice for that very purpose. After 2 months we got no where and gave up on that one.
    Now with Cloud Drive i'm even more confused.
  3. So now things are getting more desperate and I try what I hoped would be a simpler approach by using Airdrop to send the data between devices in some sort of manual unelegant workaround. Some very helpful advice from Austin here: Send NSArray Via AirDrop got somewhere close, however the file created could not be recognised by app on the target device,although sending it to mac via airdrop and opening it up in a text editior showed at least some form of data resembling my core data array.

What i'm hoping to achieve from this question

Options and advice of how to keep this table view data in sync with other devices or somehow get this data off one device and put on another by any means necessary! save to Parse? Carrier pigeon?

Community
  • 1
  • 1
JSA986
  • 5,870
  • 9
  • 45
  • 91
  • iCloud is the obvious solution, although it requires your users to have an iCloud account... – Paulw11 Oct 01 '14 at 23:33
  • Agreed, but after ages of emailing with an Apple engineer between us we couldn't rid of the duplicates with icloud sync, plus with users switching to iCloud drive this presents its own problems – JSA986 Oct 01 '14 at 23:38

1 Answers1

0

For core data syncing I recommend to use Ensembles. It’s really working!

thom_ek
  • 673
  • 4
  • 7