进行了一些搜索并且无法找到任何合适的答案。在此先感谢您帮我解决我可能遇到的微不足道的问题。
这是有问题的Json:
{
"User":{
"UserEvents":[
],
"Vendor":null,
"UserId":7,
"CreatedDate":"1900-01-01T00:00:00",
"UserName":"jasondboland@gmail.com",
"LoginCount":0,
"LastLogin":null,
"CurrentEventId":6,
"Company":null,
"FirstName":"Wedding Pro",
"LastName":"Boland",
"Gender":"female",
"Country":null,
"FacebookLink":null,
"FacebookData":null,
"PaymentToken":"",
"BillingAddress":null,
"ShippingAddress":null,
"ShipToPreference":1,
"ReferralId":null,
"BulkLicenseUpgrade":false,
"DisplayName":"Wedding Pro Boland",
"ImpersonateUser":null,
"VendorInd":false,
"AvailableLicenses":0
},
"Theme":{
"ThemeId":2,
"Name":"Tropical Beach 1",
"ThumbnailImage":"~/images/themes/tropical_beach_registry_t.jpg",
"LargeImage":"~/images/themes/tropical_beach_registry.jpg",
"Type":1,
"AccessLevel":1,
"StyleName":"tropic-beach",
"ActiveInd":true
},
"RegistryItems":[
],
"Organizers":[
{
"OrganizerId":11,
"CreatedDate":"2013-04-25T20:35:40.687",
"Address":null,
"OrganizerType":1,
"FirstName":"Jason",
"LastName":"Boland",
"Email":"jasondboland@gmail.com",
"Phone":"7143922631",
"FacebookId":null,
"PrimaryAccountInd":true,
"VerifiedInd":true,
"ActiveInd":true
},
{
"OrganizerId":12,
"CreatedDate":"2013-04-25T20:35:40.75",
"Address":null,
"OrganizerType":0,
"FirstName":"Ezzy",
"LastName":"Castillo",
"Email":null,
"Phone":null,
"FacebookId":null,
"PrimaryAccountInd":false,
"VerifiedInd":false,
"ActiveInd":true
}
],
"Attendees":[
],
"Schedules":[
{
"ScheduleId":11,
"CreatedDate":"2013-04-25T20:35:40.763",
"ScheduleType":2,
"Name":"Reception",
"Description":"Sea Cliff Country Club",
"DateStart":"2013-06-22T16:00:00",
"DateEnd":null,
"Address":null,
"ShowOnline":false,
"ActiveInd":true
},
{
"ScheduleId":12,
"CreatedDate":"2013-04-25T20:35:40.763",
"ScheduleType":1,
"Name":"Ceremony",
"Description":"Sea Cliff Country Club",
"DateStart":"2013-06-22T15:30:00",
"DateEnd":null,
"Address":null,
"ShowOnline":false,
"ActiveInd":true
}
],
"EventImages":[
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/aff69cb6-930b-4982-86e0-143d43a91da9_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/62b9c7e3-9ef8-41aa-b008-40847eb2eb18_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/b7281259-793d-4a7e-a2c7-466e2748a049_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/37cecb6b-0819-4a5e-aa21-475dfdad28c3_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/8f51398e-2cdf-47d2-a9bb-4fc32698ec18_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/a0e5f5c5-43f1-40db-b6cb-893bdf8d318e_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/17edaee6-8bdb-4988-847c-8977779c9000_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/0d460b63-9b65-4078-9660-a066c5390957_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/63536715-01ad-473f-b213-ba46f2f8a7d0_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
},
{
"ImageID":"00000000-0000-0000-0000-000000000000",
"Container":null,
"ImageName":null,
"ImageDesc":null,
"ThumbURL":null,
"MediumURL":null,
"LargeURL":"https://jjcompanies.blob.core.windows.net/eventimages/91f0675a-5df1-4c68-ae1f-e7db0c322e33_l",
"ImageType":0,
"SortOrder":0.0,
"UserEvents":null,
"RegistryItems":null
}
],
"UserEventId":6,
"CreatedDate":"2013-04-25T20:35:40.56",
"EventType":0,
"Name":"Jason Boland and Ezzy Castillo's Wedding",
"Description":"We can't wait to start out our lives together with a once in a lifetime trip to the south pacific.",
"Date":"2013-06-22T00:00:00",
"PaymentType":1,
"CurrencyType":1,
"EventLevel":1,
"RequestAddresses":true,
"ReferralCode":null,
"EventURL":"JasonAndEzzy",
"PublishedInd":true,
"PublishedDate":"2013-07-17T16:31:02.687",
"GalleryPurchasedInd":true,
"GalleryPurchasedDate":"2013-05-16T20:02:36.757",
"RequirePasswordOnGallery":false,
"EventPassword":"",
"BudgetPurchasedInd":true,
"BudgetPurchasedDate":"2013-05-16T20:02:36.757",
"GuestlistPurchasedInd":true,
"GuestlistPurchasedDate":"2013-05-16T20:02:36.757",
"GuestListInfoRequestsSent":null,
"GuestListInfoRequestsMessage":null,
"SampleInd":false,
"ActiveInd":true,
"DaysUntilWedding":"-25.13:43:16.6650000",
"PrimaryOrganizer":{
"OrganizerId":11,
"CreatedDate":"2013-04-25T20:35:40.687",
"Address":null,
"OrganizerType":1,
"FirstName":"Jason",
"LastName":"Boland",
"Email":"jasondboland@gmail.com",
"Phone":"7143922631",
"FacebookId":null,
"PrimaryAccountInd":true,
"VerifiedInd":true,
"ActiveInd":true
},
"CeremonySchedule":{
"ScheduleId":12,
"CreatedDate":"2013-04-25T20:35:40.763",
"ScheduleType":1,
"Name":"Ceremony",
"Description":"Sea Cliff Country Club",
"DateStart":"2013-06-22T15:30:00",
"DateEnd":null,
"Address":null,
"ShowOnline":false,
"ActiveInd":true
},
"ReceptionSchedule":{
"ScheduleId":11,
"CreatedDate":"2013-04-25T20:35:40.763",
"ScheduleType":2,
"Name":"Reception",
"Description":"Sea Cliff Country Club",
"DateStart":"2013-06-22T16:00:00",
"DateEnd":null,
"Address":null,
"ShowOnline":false,
"ActiveInd":true
}
}
对象:
@interface RKImage : NSObject
@property (nonatomic, copy) NSString *LargeURL;
@property (nonatomic, copy) NSString *ImageID;
@end
尝试过的代码:
RKObjectMapping* wMapping = [RKObjectMapping mappingForClass:[RKImage class]];
[wMapping addAttributeMappingsFromDictionary:@{
//@"ImageID": @"ImageID",
@"LargeURL": @"LargeURL"
}];
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:wMapping pathPattern:nil keyPath:@"EventImages" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
NSURL *URL = [NSURL URLWithString:@"http://myurl.cloudapp.net/api/mobilegallery/1"];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
RKObjectRequestOperation *objectRequestOperation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[ responseDescriptor ]];
[objectRequestOperation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
RKLogInfo(@"Load collection of Articles: %@", mappingResult.array);
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
RKLogError(@"Operation failed with error: %@", error);
}];
[objectRequestOperation start];
我收到错误:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<RKImage 0xa25b240> valueForUndefinedKey:]: this class is not key value coding-compliant for the key LargeURL.'
编辑:启用日志记录时出错
2013-07-17 16:04:43.168 SimplyTieGallery [1002:c07]我 restkit.network:RKObjectRequestOperation.m:174 GET &#39; http://4451cfc5be9c49f4896a2dd6eeec96c9.cloudapp.net/api/mobilegallery/1&#39; 2013-07-17 16:04:44.927 SimplyTieGallery [1002:4103] D. restkit.object_mapping:RKMapperOperation.m:390执行映射 表示的操作:{ ActiveInd = 1; 与会者=( ); BudgetPurchasedDate =&#34;&#34 ;; BudgetPurchasedInd = 0; CeremonySchedule = { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.803&#34 ;; DateEnd =&#34; 2013-10-08T13:11:16&#34 ;; DateStart =&#34; 2013-10-08T13:11:16&#34 ;; 描述=&#34;福尔柯克庄园和乡村俱乐部&#34 ;; 姓名=仪式; ScheduleId = 2; ScheduleType = 1; ShowOnline = 1; }; CreatedDate =&#34; 2013-04-11T13:11:13.93&#34 ;; CurrencyType = 1; 日期=&#34; 2013-10-08T00:00:00&#34 ;; DaysUntilWedding =&#34; 82.00:55:14.3863200&#34 ;; 说明=&#34;我们很快就会成为琼斯先生和琼斯女士,等不及了!虽然每个人都从大规模的聚会中恢复过来(我们的 婚礼)我们将登上飞往波拉波拉岛的飞机开始我们的生活 一起盛大的时尚!我们很幸运能够得到充分的祝福 放养回家,所以我们决定使用SimplyTie帮助我们创建 我们能想到的最神奇的蜜月。我们可以\感谢 每个人都足以满足你所有的爱,支持和慷慨!谢谢 非常! John和Judy Jones&#34 ;; EventImages =( { 容器=&#34;&#34 ;; ImageDesc =&#34;&#34 ;; ImageID =&#34; 00000000-0000-0000-0000-000000000000&#34 ;; ImageName =&#34;&#34 ;; ImageType = 0; LargeURL =&#34; https://jjcompanies.blob.core.windows.net/eventimages/c4d56b3d-840e-4093-bdc8-8369cf05da34_l&#34 ;; MediumURL =&#34;&#34 ;; RegistryItems =&#34;&#34 ;; SortOrder = 0; ThumbURL =&#34;&#34 ;; UserEvents =&#34;&#34 ;; }, { 容器=&#34;&#34 ;; ImageDesc =&#34;&#34 ;; ImageID =&#34; 00000000-0000-0000-0000-000000000000&#34 ;; ImageName =&#34;&#34 ;; ImageType = 0; LargeURL =&#34; https://jjcompanies.blob.core.windows.net/eventimages/cd22c262-8cbc-480b-b0ee-a4b33e248b70_l&#34 ;; MediumURL =&#34;&#34 ;; RegistryItems =&#34;&#34 ;; SortOrder = 0; ThumbURL =&#34;&#34 ;; UserEvents =&#34;&#34 ;; } ); EventLevel = 1; EventPassword =&#34;&#34 ;; EventType = 0; EventURL = BoraBoraSample; GalleryPurchasedDate =&#34; 2013-04-26T00:11:45.427&#34 ;; GalleryPurchasedInd = 1; GuestListInfoRequestsMessage =&#34;&#34 ;; GuestListInfoRequestsSent =&#34;&#34 ;; GuestlistPurchasedDate =&#34;&#34 ;; GuestlistPurchasedInd = 0; 姓名=&#34;约翰和朱迪的婚礼&#34 ;; 主办单位=( { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.32&#34 ;; Email =&#34; JudyMcGride@SimplyTie.com" ;; FacebookId =&#34;&#34 ;; FirstName = Judy; LastName = McBride; OrganizerId = 1; OrganizerType = 0; 电话=&#34;&#34 ;; PrimaryAccountInd = 1; VerifiedInd = 1; }, { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.323&#34 ;; Email =&#34; JohnJones@SimplyTie.com" ;; FacebookId =&#34;&#34 ;; FirstName = John; LastName =琼斯; OrganizerId = 2; OrganizerType = 1; 电话=&#34;&#34 ;; PrimaryAccountInd = 0; VerifiedInd = 1; } ); PaymentType = 1; PrimaryOrganizer = { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.32&#34 ;; Email =&#34; JudyMcGride@SimplyTie.com" ;; FacebookId =&#34;&#34 ;; FirstName = Judy; LastName = McBride; OrganizerId = 1; OrganizerType = 0; 电话=&#34;&#34 ;; PrimaryAccountInd = 1; VerifiedInd = 1; }; PublishedDate =&#34; 2013-04-11T13:11:13.93&#34 ;; PublishedInd = 1; ReceptionSchedule = { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.803&#34 ;; DateEnd =&#34; 2013-10-08T13:11:16&#34 ;; DateStart =&#34; 2013-10-08T13:11:16&#34 ;; 描述=&#34;福尔柯克庄园和乡村俱乐部&#34 ;; 姓名=接待; ScheduleId = 1; ScheduleType = 2; ShowOnline = 1; }; ReferralCode =&#34;&#34 ;; RegistryItems =( ); RequestAddresses = 1; RequirePasswordOnGallery = 0; SampleInd = 1; 时间表=( { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.803&#34 ;; DateEnd =&#34; 2013-10-08T13:11:16&#34 ;; DateStart =&#34; 2013-10-08T13:11:16&#34 ;; 描述=&#34;福尔柯克庄园和乡村俱乐部&#34 ;; 姓名=接待; ScheduleId = 1; ScheduleType = 2; ShowOnline = 1; }, { ActiveInd = 1; 地址=&#34;&#34 ;; CreatedDate =&#34; 2013-04-11T13:11:16.803&#34 ;; DateEnd =&#34; 2013-10-08T13:11:16&#34 ;; DateStart =&#34; 2013-10-08T13:11:16&#34 ;; 描述=&#34;福尔柯克庄园和乡村俱乐部&#34 ;; 姓名=仪式; ScheduleId = 2; ScheduleType = 1; ShowOnline = 1; } ); 主题= { AccessLevel = 1; ActiveInd = 1; LargeImage =&#34;〜/ images / themes / tropical_beach_registry.jpg&#34 ;; 名称=&#34;热带海滩1&#34 ;; StyleName =&#34; tropic-beach&#34 ;; ThemeId = 2; ThumbnailImage =&#34;〜/ images / themes / tropical_beach_registry_t.jpg&#34 ;; Type = 1; }; 用户= { AvailableLicenses = 0; BillingAddress =&#34;&#34 ;; BulkLicenseUpgrade = 0; 公司=&#34;&#34 ;; 国家=&#34;&#34 ;; CreatedDate =&#34; 1900-01-01T00:00:00&#34 ;; CurrentEventId = 1; DisplayName =&#34; John Sample&#34 ;; FacebookData =&#34;&#34 ;; FacebookLink =&#34;&#34 ;; FirstName = John; 性别=男性; ImpersonateUser =&#34;&#34 ;; LastLogin =&#34;&#34 ;; LastName = Sample; LoginCount = 0; PaymentToken =&#34;&#34 ;; ReferralId =&#34;&#34 ;; ShipToPreference = 2; ShippingAddress =&#34;&#34 ;; UserEvents =( ); UserId = 1; UserName =&#34; boraborasample@simplytie.com" ;; 供应商=&#34;&#34 ;; VendorInd = 0; }; UserEventId = 1; }和targetObject :( null)2013-07-17 16:04:44.930 SimplyTieGallery [1002:4103] T restkit.object_mapping:RKMapperOperation.m:333检查keyPath &#39; EventImages&#39;对于可映射的内容... 2013-07-17 16:04:44.930 SimplyTieGallery [1002:4103] D. restkit.object_mapping:RKMapperOperation.m:310找到了mappable 在keyPath&#39; EventImages&#39;收集:( { 容器=&#34;&#34 ;; ImageDesc =&#34;&#34 ;; ImageID =&#34; 00000000-0000-0000-0000-000000000000&#34 ;; ImageName =&#34;&#34 ;; ImageType = 0; LargeURL =&#34; https://jjcompanies.blob.core.windows.net/eventimages/c4d56b3d-840e-4093-bdc8-8369cf05da34_l&#34 ;; MediumURL =&#34;&#34 ;; RegistryItems =&#34;&#34 ;; SortOrder = 0; ThumbURL =&#34;&#34 ;; UserEvents =&#34;&#34 ;; }, { 容器=&#34;&#34 ;; ImageDesc =&#34;&#34 ;; ImageID =&#34; 00000000-0000-0000-0000-000000000000&#34 ;; ImageName =&#34;&#34 ;; ImageType = 0; LargeURL =&#34; https://jjcompanies.blob.core.windows.net/eventimages/cd22c262-8cbc-480b-b0ee-a4b33e248b70_l&#34 ;; MediumURL =&#34;&#34 ;; RegistryItems =&#34;&#34 ;; SortOrder = 0; ThumbURL =&#34;&#34 ;; UserEvents =&#34;&#34 ;; })2013-07-17 16:04:44.931 SimplyTieGallery [1002:4103] D restkit.object_mapping:RKMapperOperation.m:244问到地图来源 对象{ 容器=&#34;&#34 ;; ImageDesc =&#34;&#34 ;; ImageID =&#34; 00000000-0000-0000-0000-000000000000&#34 ;; ImageName =&#34;&#34 ;; ImageType = 0; LargeURL =&#34; https://jjcompanies.blob.core.windows.net/eventimages/c4d56b3d-840e-4093-bdc8-8369cf05da34_l&#34 ;; MediumURL =&#34;&#34 ;; RegistryItems =&#34;&#34 ;; SortOrder = 0; ThumbURL =&#34;&#34 ;; UserEvents =&#34;&#34 ;;使用映射LargeURL&gt;&#34; )&GT; 2013-07-17 16:04:44.931 SimplyTieGallery [1002:4103] D. restkit.object_mapping:RKMappingOperation.m:912开始映射 操作... 2013-07-17 16:04:44.932 SimplyTieGallery [1002:4103] T. restkit.object_mapping:RKMappingOperation.m:913执行映射 操作:对于RKImage&#39;宾语。 映射对象{的值 容器=&#34;&#34 ;; ImageDesc =&#34;&#34 ;; ImageID =&#34; 00000000-0000-0000-0000-000000000000&#34 ;; ImageName =&#34;&#34 ;; ImageType = 0; LargeURL =&#34; https://jjcompanies.blob.core.windows.net/eventimages/c4d56b3d-840e-4093-bdc8-8369cf05da34_l&#34 ;; MediumURL =&#34;&#34 ;; RegistryItems =&#34;&#34 ;; SortOrder = 0; ThumbURL =&#34;&#34 ;; UserEvents =&#34;&#34 ;;用对象映射对象(null)2013-07-17 16:04:44.932 SimplyTieGallery [1002:4103] T. restkit.object_mapping:RKMappingOperation.m:515 Mapping属性 价值keyPath&#39; LargeURL&#39;到&#39; LargeURL&#39; 2013-07-17 16:04:44.933 SimplyTieGallery [1002:1703] D. restkit.object_mapping:RKPropertyInspector.m:126缓存属性 检查班级&#39; RKImage&#39;:{ ImageID = { isPrimitive = 0; keyValueCodingClass = NSString; name = ImageID; }; LargeURL = { isPrimitive = 0; keyValueCodingClass = NSString; name = LargeURL; }; 2013-07-17 16:04:44.933 SimplyTieGallery [1002:4103] *由于未捕获的异常终止应用&#39; NSUnknownKeyException&#39;, 原因:&#39; [valueForUndefinedKey:]:这个类是 密钥LargeURL不符合密钥值编码。&#39; * 第一次抛出调用堆栈:(0x1e68012 0x1c8de7e 0x1ef0fb1 0x1962d1d 0x18cf00b 0x18cefbd 0x18ed247 0xa3561 0xa4a92 0xa5e39 0xad45d 0x18ef453 0x18ef164 0x9bb79 0x9b018 0x1e61e7c 0x1e61a16 0x1e61925 0x9accb 0x9cbff 0x9d657 0x9e021 0x18ef453 0x18ef164 0x8c850 0x8a955 0x18ef453 0x18ef164 0x197ba31 0x254b53f 0x255d014 0x254e2e8 0x254e450 0x91453e72 0x9143bd2a)libc ++ abi.dylib:终止调用throw a 异常(lldb)
尝试搞乱keyPaths,我只是无处可去。谢谢!