Safely set the copies property
This commit is contained in:
parent
fa00761d3c
commit
4bba693cd5
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "APPPrinterInfo.h"
|
#include "APPPrinterInfo.h"
|
||||||
|
|
||||||
|
#import <objc/message.h>
|
||||||
|
|
||||||
@implementation APPPrinterInfo
|
@implementation APPPrinterInfo
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@ -71,7 +73,10 @@
|
|||||||
info.duplex = UIPrintInfoDuplexNone;
|
info.duplex = UIPrintInfoDuplexNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (class_getProperty(info.class, "copies"))
|
||||||
|
{
|
||||||
[info setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"];
|
[info setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"];
|
||||||
|
}
|
||||||
|
|
||||||
if (jobName)
|
if (jobName)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user