Reputation: 31863
I have a piece of code like this:
AVCaptureScreenInput *input = [[AVCaptureScreenInput alloc] initWithDisplayID:screen.displayID];
input.capturesCursor = NO;
input.capturesMouseClicks = NO;
AVCaptureScreenInput.capturesCursor
is only available in 10.8+. My app supports 10.7+.
How do I maintain compatibility? Should I remove the call completely? Check the OS version at runtime?
Upvotes: 1
Views: 69
Reputation: 8218
You should check if the property exists in runtime.
This code should do the trick:
AVCaptureScreenInput *input = [[AVCaptureScreenInput alloc] initWithDisplayID:screen.displayID];
if ([input respondsToSelector:@selector(setCapturesCursor:)]) {
input.capturesCursor = NO;
}
input.capturesMouseClicks = NO;
Upvotes: 4