NSInvalidArgumentException',原因:'JSON写入声音无效(声音)

时间:2015-04-20 14:20:12

标签: json parse-platform nsdictionary invalid-argument

//将配音保存到数据库

NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys:[DubsUtils dubUrlFromPath:trimmedDubPath], @"url", _sound, @"sound", nil];

if([NSJSONSerialization isValidJSONObject:dict])
{
    NSLog(@"Valid ... %@", dict);
    NSError *err;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&err];
    NSLog(@"Done .. err : %@ Data : %@",err,jsonData);


    PFObject *data = [PFObject objectWithClassName:@"DubsData"];
    data[@"dubs"] = dict;

    [data saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        if (succeeded) {
            // The object has been saved.
            NSLog(@"New dub uploaded...");
        } else {
            NSLog(@"New dub Problem uploaded...");
            // There was a problem, check error.description
        }
    }];

}
else
    NSLog(@"Not Valid ... \n Detail : %@ \n data : ",dict);
  

O / P:无效......详情:{       sound =“sound:Hilarious Dolphin - url:dolphin.mp3 - category:Category n \ U00b02 - name:Local Category 2 - lang:en”;       url =“LMHFuxhDfUb9i2tm0Qryn67eZ4kH6n.mov”; }

我想在解析服务器上存储这个dict var对象

0 个答案:

没有答案