Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9702

Fix plugin initialization based on XCode 7.0 compiler warnings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Master
    • None
    • None
    • XCode Version 7.0 (7A220)

    Description

      xcode complains "These will always evaluate to true", which, looking at these lines, makes sense. These things are objects, taking their address will always yield a non-null value.

      cordova-plugin-network-information pstoll$ git diff
      diff --git a/src/ios/CDVConnection.m b/src/ios/CDVConnection.m
      index 3749767..223dd7c 100644
      --- a/src/ios/CDVConnection.m
      +++ b/src/ios/CDVConnection.m
      @@ -118,7 +118,7 @@
           [self.internetReach startNotifier];
           [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:)
                                                        name:kReachabilityChangedNotification object:nil];
      -    if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification) {
      +    if (UIApplicationDidEnterBackgroundNotification && UIApplicationWillEnterForegroundNotification) {
               [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil];
               [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil];
           }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            pstoll Perry Stoll
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: