I am trying to add an image to my JSON file that I want to publish on the server. I am using the following code, but I keep getting the error Invalid type in JSON write (NSConcreteMutableData) . Code
NSDictionary *parameter = [[NSDictionary alloc]init]; NSData *imageData = UIImagePNGRepresentation(imageView.image); parameter = @{@"body":@"Hi",@"image":imageData};
In addition, I use AFNetworking to host the image on the server.
I am not sure what is wrong with the code. Any help would be greatly appreciated
source share