0
我有一個iOS應用程序使用RestKit從我們的服務器端API以JSON格式提取數據。我一直在爲它工作了大約一年,而我之前從未見過這種情況 - 出於某種原因,RestKit似乎將ID 1047470映射爲-1106。RestKit對象映射將ID映射爲完全不同的負數
它看起來可能是一個錯誤代碼,但我不知道爲什麼它會顯示爲映射值,而不是實際的錯誤。其他ID映射工作正常,所有其他ID(據我所知),我們正在使用的許多其他實體。
對象映射調試日誌摘錄如下。 (因爲他們在這一點不需要我不是映射一些值呢。)
2015-10-21 10:27:50.577 App[13381:9422581] D restkit.object_mapping:RKMapperOperation.m:327 Found mappable collection at keyPath 'members': (
{
accountName = "Test Account Name";
memberEmail = "test##test.com";
memberFirstName = TestFirst;
memberId = 1047470;
memberLastName = "TestLast";
planId = 1;
smsConfirm = 0;
}
)
2015-10-21 10:27:50.578 App[13381:9422581] D restkit.object_mapping:RKMapperOperation.m:251 Asked to map source object {
accountName = "Test Account Name";
memberEmail = "test##test.com";
memberFirstName = TestFirst;
memberId = 1047470;
memberLastName = "TestLast";
planId = 1;
smsConfirm = 0;
} with mapping <RKEntityMapping:0x7ff3c86eaf10 objectClass=Member propertyMappings=(
"<RKAttributeMapping: 0x7ff3c86eb360 memberId => memberId>",
"<RKAttributeMapping: 0x7ff3c86ebd10 smsConfirm => smsConfirm>",
"<RKAttributeMapping: 0x7ff3c86eca20 planId => planId>"
)>
2015-10-21 10:27:50.578 App[13381:9422581] D restkit.object_mapping:RKMappingOperation.m:1159 Starting mapping operation...
2015-10-21 10:27:50.579 App[13381:9422581] D restkit.object_mapping:RKMappingOperation.m:1244 Finished mapping operation successfully...
2015-10-21 10:27:50.584 App[13381:9422581] D restkit.object_mapping:RKMapperOperation.m:433 Finished performing object mapping. Results: {
members = (
"<Member: 0x7ff3cd542a90> (entity: Member; id: 0x7ff3d3bd1ab0 <x-coredata:///Member/tC7917ADF-B44F-481D-BF96-F4F4C03B18AF3> ; data: {\n memberId = \"-1106\";\n planId = 1;\n smsConfirm = 0;\n})"
);
}
任何人都知道爲什麼會發生?