i used that code to flatten Annotations :
-(void)flattenButtonPressed:(id)_sender {
if (true) {
[docToOpen FlattenAnnotations: false];
}
}
It works, and after I pressed Flatten Button, all of my annotations in pdf file can not be edited. I just can add new annotations and edit it.
But It cause an error like this :

Can anyone tell me a solution??? Please! :(