cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] cordova-plugin-camera git commit: CB-8351 ios: Stop using now-deprecated integerValueForKey: class extension
Date Tue, 27 Jan 2015 15:56:46 GMT
Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master 2a0735d55 -> 80b004838


CB-8351 ios: Stop using now-deprecated integerValueForKey: class extension


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/2ead6335
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/2ead6335
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/2ead6335

Branch: refs/heads/master
Commit: 2ead6335c92deb117cc3ef84d0a15db296de8dc5
Parents: 2a0735d
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Jan 27 10:47:04 2015 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jan 27 10:47:04 2015 -0500

----------------------------------------------------------------------
 src/ios/CDVCamera.m | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/2ead6335/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index 1672087..20954a2 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -173,6 +173,18 @@ static NSSet* org_apache_cordova_validArrowDirections;
     [self displayPopover:options];
 }
 
+- (NSInteger)integerValueForKey:(NSDictionary*)dict key:(NSString*)key defaultValue:(NSInteger)defaultValue
+{
+    NSInteger value = defaultValue;
+
+    NSNumber* val = [self valueForKey:key];  // value is an NSNumber
+
+    if (val != nil) {
+        value = [val integerValue];
+    }
+    return value;
+}
+
 - (void)displayPopover:(NSDictionary*)options
 {
     NSInteger x = 0;
@@ -182,11 +194,11 @@ static NSSet* org_apache_cordova_validArrowDirections;
     UIPopoverArrowDirection arrowDirection = UIPopoverArrowDirectionAny;
 
     if (options) {
-        x = [options integerValueForKey:@"x" defaultValue:0];
-        y = [options integerValueForKey:@"y" defaultValue:32];
-        width = [options integerValueForKey:@"width" defaultValue:320];
-        height = [options integerValueForKey:@"height" defaultValue:480];
-        arrowDirection = [options integerValueForKey:@"arrowDir" defaultValue:UIPopoverArrowDirectionAny];
+        x = [self integerValueForKey:options key:@"x" defaultValue:0];
+        y = [self integerValueForKey:options key:@"y" defaultValue:32];
+        width = [self integerValueForKey:options key:@"width" defaultValue:320];
+        height = [self integerValueForKey:options key:@"height" defaultValue:480];
+        arrowDirection = [self integerValueForKey:options key:@"arrowDir" defaultValue:UIPopoverArrowDirectionAny];
         if (![org_apache_cordova_validArrowDirections containsObject:[NSNumber numberWithUnsignedInteger:arrowDirection]])
{
             arrowDirection = UIPopoverArrowDirectionAny;
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message