You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2013/09/16 21:31:00 UTC

git commit: [CB-4824] Fix XCode 5 contacts plugin warnings

Updated Branches:
  refs/heads/dev 225255d91 -> 9608db091


[CB-4824] Fix XCode 5 contacts plugin warnings


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/9608db09
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/9608db09
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/9608db09

Branch: refs/heads/dev
Commit: 9608db091cf26dff8415dccaac702a0c959cdcbf
Parents: 225255d
Author: James Jong <wj...@gmail.com>
Authored: Mon Sep 16 15:29:58 2013 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Mon Sep 16 15:29:58 2013 -0400

----------------------------------------------------------------------
 src/ios/CDVContacts.m | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/9608db09/src/ios/CDVContacts.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVContacts.m b/src/ios/CDVContacts.m
index 3ca3e81..7ca6c80 100644
--- a/src/ios/CDVContacts.m
+++ b/src/ios/CDVContacts.m
@@ -91,9 +91,11 @@
 
         UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:npController];
 
-        if ([weakSelf.viewController respondsToSelector:@selector(presentViewController:::)]) {
+        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
+        if ([weakSelf.viewController respondsToSelector:selector]) {
             [weakSelf.viewController presentViewController:navController animated:YES completion:nil];
         } else {
+            // deprecated as of iOS >= 6.0
             [weakSelf.viewController presentModalViewController:navController animated:YES];
         }
     }];
@@ -151,9 +153,11 @@
 
             [navController pushViewController:personController animated:YES];
 
-            if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
+            SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
+            if ([self.viewController respondsToSelector:selector]) {
                 [self.viewController presentViewController:navController animated:YES completion:nil];
             } else {
+                // deprecated as of iOS >= 6.0
                 [self.viewController presentModalViewController:navController animated:YES];
             }
 
@@ -193,9 +197,11 @@
     pickerController.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kABRecordInvalidID], kW3ContactId, nil];
     pickerController.allowsEditing = (BOOL)[options existsValue : @"true" forKey : @"allowsEditing"];
 
-    if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
+    SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
+    if ([self.viewController respondsToSelector:selector]) {
         [self.viewController presentViewController:pickerController animated:YES completion:nil];
     } else {
+        // deprecated as of iOS >= 6.0
         [self.viewController presentModalViewController:pickerController animated:YES];
     }
 }