繁体   English   中英

使用解析本地数据存储导致应用崩溃

[英]App Crashes using Parse local datastore

我使用Parse本地商店开发了一个应用程序,因为大多数情况下,使用该应用程序的人没有互联网连接,我的动作非常基本,我只保存数据,然后将其发送给parse(当他们有连接时),在大多数情况下都可以正常工作但有时,当他们要打开应用程序时,它会突然最小化。

测试该应用程序后,我发现发生此错误:

[__NSCFDictionary fetchFromLocalDatastoreInBackground]:无法识别的选择器已发送到实例xxxxxxx。

我的问题是:是否有人对如何解决此问题有想法?

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];

即时通讯使用此代码保存多个请求,然后当Internet进入ipad时,请求“保存”。

发生此错误的原因本身是因为存储在数据存储中的请求存储在何处,并且由于内存问题导致应用程序崩溃导致此错误。

另一方面,我的解决方案是鼓励用户在不使用互联网的情况下保存他们想要的任何内容,但要确保通过互联网连接完成一天的最后一次保存,这显然会立即发送所有已存储的数据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM