Reputation: 555
I am getting below error when I am using Dictionary with array of object :
NSMutableDictionary *jsonDict=[[NSMutableDictionary alloc] init];
[jsonDict setObject:checkMarkPresetRecipientsArray forKey:@"Names"];
[jsonDict setObject:checkMarkDocumentGroupNameArray forKey:@"Address"];
json = [jsonDict JSONFragment];
Error : JSONFragment failed. Error trace is: ( "Error Domain=org.brautaset.JSON.ErrorDomain Code=1 \"JSON serialisation not supported for DocumentType\" UserInfo=0xb5cc270 {NSLocalizedDescription=JSON serialisation not supported for DocumentType}", "Error Domain=org.brautaset.JSON.ErrorDomain Code=1 \"Unsupported value for key DocumentTypes in object\" UserInfo=0xb580e60 {NSUnderlyingError=0xb585320 \"JSON serialisation not supported for DocumentType\", NSLocalizedDescription=Unsupported value for key DocumentTypes in object}" )
but not getting same error with :
NSMutableDictionary *jsonDict=[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Nitesh",@"Name", @"Balaghat",@"Address",nil];
NSString *json=[jsonDict JSONRepresentation];
NSLog(@"%@",json);
above gives me correct JSON representation.
What I am doing wrong? can any one help me on above....
Actually my array contains core data class object and it's not supporting JSON representation so I changed by implementation now it's working fine. If is there any way to change coredata class objects representation in JSON please update me. Thanks.
Upvotes: 0
Views: 608
Reputation: 555
Thanks @Abezern @graver @iPatel
Actually my array contains core data class object and it's not supporting JSON representation so I changed by implementation now it's working fine.
Upvotes: 0