我从 Parse.com 请求 NSDictionary 的文件表示(是的,我知道还有其他更明显的方法来存储字典),然后在完成块中,数据被取消归档并分配给属性。
当此代码执行时,它似乎永远不会从 unarchive 行返回。没有冻结,没有错误或异常。该应用程序继续运行,好像一切都很好。如果我在 unarchiver 行和它之后的行设置断点,第一个断点会被命中,但第二个断点永远不会。
我可以确认该函数已返回此文件的预期数据量。
PFFile *definitionFile = appObject[@"myFile"]; //PFFile reference from a PFObject
[definitionFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
if (data) {
//A breakpoint on the following line does fire and show that there is data being given to the unarchiver
self.pendingDefinition = (NSDictionary *) [NSKeyedUnarchiver unarchiveObjectWithData:data];
}
//////Nothing beyond this point gets executed////////
[self handleNewDefinition];
} else {
NSLog(@"ERROR");
}
}];