Safely set the copies property

This commit is contained in:
Sebastián Katzer 2019-02-13 12:08:03 +01:00
parent fa00761d3c
commit 4bba693cd5

View File

@ -21,6 +21,8 @@
#include "APPPrinterInfo.h"
#import <objc/message.h>
@implementation APPPrinterInfo
#pragma mark -
@ -71,7 +73,10 @@
info.duplex = UIPrintInfoDuplexNone;
}
[info setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"];
if (class_getProperty(info.class, "copies"))
{
[info setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"];
}
if (jobName)
{