phonegap / phonegap-plugin-contentsync

Download and cache remotely hosted content
Apache License 2.0
206 stars 98 forks source link

[iOS] [via Repo URL] Build Failed - Expected Expression #129

Closed roblav96 closed 8 years ago

roblav96 commented 8 years ago

Expected Expression

😢

Xcode 7.3 Build version 7D175 Node version: v5.10.1 Cordova version: 6.1.1

roblav96 commented 8 years ago

Commenting out the line fixes it.

shazron commented 8 years ago

Repro'ed.

Using cordova-cli 6.2.0 and cordova-ios 4.1.1 in a new project. Xcode 7.3.1

/Users/shaz/Desktop/f/platforms/ios/f/Plugins/phonegap-plugin-contentsync/ContentSync.m:146:14: warning: 
      incompatible pointer to integer conversion initializing 'BOOL'
      (aka 'signed char') with an expression of type 'id' [-Wint-conversion]
        BOOL trustHost = [command argumentAtIndex:7 withDefault:@(NO)];
             ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/shaz/Desktop/f/platforms/ios/f/Plugins/phonegap-plugin-contentsync/ContentSync.m:345:116: error: 
      expected expression
  ...HTTP Error Code: %ld", task, [(NSHTTPURLResponse*)[task response] (long)status...
                                                                        ^
/Users/shaz/Desktop/f/platforms/ios/f/Plugins/phonegap-plugin-contentsync/ContentSync.m:552:56: warning: 
      'backgroundSessionConfiguration:' is deprecated: first deprecated in iOS 8.0 -
      Please use backgroundSessionConfigurationWithIdentifier: instead
      [-Wdeprecated-declarations]
            configuration = [NSURLSessionConfiguration backgroundSessionConfig...
                                                       ^
In module 'Foundation' imported from /Users/shaz/Desktop/f/platforms/ios/f/Plugins/phonegap-plugin-contentsync/ContentSync.h:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:817:1: note: 
      'backgroundSessionConfiguration:' has been explicitly marked deprecated here
+ (NSURLSessionConfiguration *)backgroundSessionConfiguration:(NSString *)iden...
^
2 warnings and 1 error generated.
shazron commented 8 years ago

It just doesn't like the (long) cast, removing it fixes it. statusCode is a NSInteger which is already defined as a long.

shazron commented 8 years ago

Filed PR #131 Edit: Oops, didn't see #130. Merging that instead.