lundi 26 janvier 2015

App Crashes using Parse local datastore

I developed an app using Parse local store as most of the time the people using it have no internet connection my actions are pretty basic i only save data and then send it to parse(when they have connection), most of the time this works fine but sometimes when they are going to open the app it suddenly minimizes.


Testing the app i found that when this happens this error occurs:


[__NSCFDictionary fetchFromLocalDatastoreInBackground]: unrecognized selector sent to instance xxxxxxx.


My question is: Does anyone have ideas on how to resolve this issue?


UPDATE



PFObject *theObject = [PFObject objectWithClassName:@"ERAV"];
[theObject saveEventually];

theObject[@"Piloto"] = facade.ThePilot;
theObject[@"Copiloto"] = facade.TheCopilot;

theObject[@"Fecha"] = facade.TheDate;
theObject[@"Origen"] = facade.TheOrigin;
theObject[@"Destino"] = facade.TheDestination;
theObject[@"Matricula"] = facade.TheLicence;
theObject[@"Hora"] = facade.TheTime;

//Questions

theObject[@"Pregunta1"] = [NSString stringWithFormat:@"%d",facade.answer1];
theObject[@"Pregunta2"] = [NSString stringWithFormat:@"%d",facade.answer2];
theObject[@"Pregunta3"] = [NSString stringWithFormat:@"%d",facade.answer3];
theObject[@"Pregunta4"] = [NSString stringWithFormat:@"%d",facade.answer4];
theObject[@"Pregunta5"] = [NSString stringWithFormat:@"%d",facade.answer5];
theObject[@"Pregunta6"] = [NSString stringWithFormat:@"%d",facade.answer6];
theObject[@"Pregunta7"] = [NSString stringWithFormat:@"%d",facade.answer7];
theObject[@"Pregunta8"] = [NSString stringWithFormat:@"%d",facade.answer8];
theObject[@"Pregunta9"] = [NSString stringWithFormat:@"%d",facade.answer9];
theObject[@"Pregunta10"] = [NSString stringWithFormat:@"%d",facade.answer10];
theObject[@"Pregunta11"] = [NSString stringWithFormat:@"%d",facade.answer11];
theObject[@"Pregunta12"] = [NSString stringWithFormat:@"%d",facade.answer12];
theObject[@"Pregunta13"] = [NSString stringWithFormat:@"%d",facade.answer13];
theObject[@"Pregunta14"] = [NSString stringWithFormat:@"%d",facade.answer14];
theObject[@"Pregunta15"] = [NSString stringWithFormat:@"%d",facade.answer15];
theObject[@"Pregunta16"] = [NSString stringWithFormat:@"%d",facade.answer16];
theObject[@"Pregunta17"] = [NSString stringWithFormat:@"%d",facade.answer17];
theObject[@"Pregunta18"] = [NSString stringWithFormat:@"%d",facade.answer18];
theObject[@"Pregunta19"] = [NSString stringWithFormat:@"%d",facade.answer19];
theObject[@"Pregunta20"] = [NSString stringWithFormat:@"%d",facade.answer20];
theObject[@"Pregunta21"] = [NSString stringWithFormat:@"%d",facade.answer21];
theObject[@"Pregunta22"] = [NSString stringWithFormat:@"%d",facade.answer22];
theObject[@"Pregunta23"] = [NSString stringWithFormat:@"%d",facade.answer23];
theObject[@"Pregunta24"] = [NSString stringWithFormat:@"%d",facade.answer24];
theObject[@"Pregunta25"] = [NSString stringWithFormat:@"%d",facade.answer25];
theObject[@"Pregunta26"] = [NSString stringWithFormat:@"%d",facade.answer26];
theObject[@"Pregunta27"] = [NSString stringWithFormat:@"%d",facade.answer27];
theObject[@"Pregunta28"] = [NSString stringWithFormat:@"%d",facade.answer28];
theObject[@"Pregunta29"] = [NSString stringWithFormat:@"%d",facade.answer29];
theObject[@"Pregunta30"] = [NSString stringWithFormat:@"%d",facade.answer30];
theObject[@"Pregunta31"] = [NSString stringWithFormat:@"%d",facade.answer31];
theObject[@"Pregunta32"] = [NSString stringWithFormat:@"%d",facade.answer32];
theObject[@"Pregunta33"] = [NSString stringWithFormat:@"%d",facade.answer33];
theObject[@"Pregunta34"] = [NSString stringWithFormat:@"%d",facade.answer34];
theObject[@"Pregunta35"] = [NSString stringWithFormat:@"%d",facade.answer35];
theObject[@"Pregunta36"] = [NSString stringWithFormat:@"%d",facade.answer36];
theObject[@"Pregunta37"] = [NSString stringWithFormat:@"%d",facade.answer37];
theObject[@"Pregunta38"] = [NSString stringWithFormat:@"%d",facade.answer38];
theObject[@"Pregunta39"] = [NSString stringWithFormat:@"%d",facade.answer39];


//Extras
theObject[@"ValorTotal"] = [NSString stringWithFormat:@"%d",facade.total];
theObject[@"RiesgoTotal"] = [self getTotalRisk];
if (facade.internationalNA)
{
theObject[@"VueloInternacional"] = [NSString stringWithFormat:@"%@",@"NO"];
}
else
{
theObject[@"VueloInternacional"] = [NSString stringWithFormat:@"%@",@"SI"];
}

[theObject saveEventually];


im using this code to save several requests and then when internet comes to the ipad the request "saves".




Aucun commentaire:

Enregistrer un commentaire