You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/06/07 00:53:07 UTC

ios commit: Implemented CB-857 - Add deprecation notice if user is running iOS lesser than 4.2

Updated Branches:
  refs/heads/master 1608652e9 -> 5f8f7ef4d


Implemented CB-857 - Add deprecation notice if user is running iOS lesser than 4.2


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/5f8f7ef4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/5f8f7ef4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/5f8f7ef4

Branch: refs/heads/master
Commit: 5f8f7ef4dd763f0bd18df524f76bcdf79135c790
Parents: 1608652
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Jun 6 15:52:32 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Jun 6 15:52:45 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/5f8f7ef4/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 7e318ec..afb3bc8 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -75,12 +75,13 @@
         [self setWantsFullScreenLayout:YES];
         
         [self printMultitaskingInfo];
+        [self printDeprecationNotice];
     }
     
     return self; 
 }
 
--(id) initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
+- (id) initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
 {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     return [self __init];
@@ -92,6 +93,16 @@
     return [self __init];
 }
 
+- (void) printDeprecationNotice
+{
+    if (!IsAtLeastiOSVersion(@"4.2")) { // TODO: change WARNING to CRITICAL for 2.0
+        NSLog(@"WARNING: For Cordova 2.0 (you are using Cordova %@), you will need to upgrade to at least iOS 4.2 or greater. Your current version of iOS is %@.", 
+              [CDVViewController cordovaVersion], 
+              [[UIDevice currentDevice] systemVersion]
+              );
+    } 
+}
+
 - (void) printMultitaskingInfo
 {
     UIDevice* device = [UIDevice currentDevice];