PFIncrementalStore
PFIncrementalStore copied to clipboard
PFFile downloading but wont upload.
PFFiles are sync'd from parse to local db without a problem. However when a NSData field in the model is created/update the new image is not sync'd back to parse.
Update Error: Error Domain=Parse Code=111 "The operation couldn’t be completed. (Parse error 111.)" UserInfo=0x155ce710 {code=111, error=invalid type for key photo, expected file, but got bytes}
The following change to setValuesFromManagedObject will solve the issue for now:
id value = [managedObject valueForKey:attributeName];
if (value) {
if([value isKindOfClass:[NSData class]])
{
PFFile *imageFile = [PFFile fileWithData:value];
[self setValue:imageFile forKey:attributeName];
} else {
[self setObject:value forKey:attributeName];
}
} else {
[self removeObjectForKey:attributeName];
}