Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • optionally using iPhone OS 3.0 features in a 2.0 compatible app?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 275
    Comment on it

    We can check if that specific method available in this version of sdk or not.

    For example there is method AVCaptureAutoFocusRangeRestriction of class AVCaptureDevice which is available in iOS 7 but not in iOS 6. So to check we can do the following :

    SEL sel = @selector(setAutoFocusRangeRestriction:);
    
    if([device respondsToSelector:sel])
      {
    
         // calling function available in iOS 7
          NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[device methodSignatureForSelector:sel]];
          [inv setSelector:sel];
          [inv setTarget:device];
          int AVCaptureAutoFocusRangeRestrictionFarValue = 2;
          [inv setArgument:&AVCaptureAutoFocusRangeRestrictionFarValue atIndex:2];
          [inv invoke];
      }
    else
     {
        call function available in iOS 6
     }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: