cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [03/13] git commit: [CB-4824] Fix XCode 5 contacts plugin warnings
Date Thu, 26 Sep 2013 22:24:41 GMT
[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/master
Commit: 9608db091cf26dff8415dccaac702a0c959cdcbf
Parents: 225255d
Author: James Jong <wjamesjong@gmail.com>
Authored: Mon Sep 16 15:29:58 2013 -0400
Committer: James Jong <wjamesjong@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];
     }
 }


Mime
View raw message