Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count is unavailable: there is no universally good answer, see the documentation comment for discussion #286

Open
capimichi opened this issue Jan 23, 2018 · 5 comments

Comments

@capimichi
Copy link

capimichi commented Jan 23, 2018

I receive this error "Count is unavailable: there is no universally good answer, see the documentation comment for discussion" in Request.swift:

    /**
    append the parameters as a HTTP Query string. (e.g. domain.com?first=one&second=two)
    -parameter parameters: The container (array or dictionary) to convert and append to the URL
    */
    public mutating func appendParametersAsQueryString(_ parameters: HTTPParameterProtocol) {
        let queryString = parameters.createPairs(nil).map({ (pair) in
            return pair.escapedValue
        }).joined(separator: "&")
        if let u = self.url , queryString.count > 0 {
            let para = u.query != nil ? "&" : "?"
            self.url = URL(string: "\(u.absoluteString)\(para)\(queryString)")
        }
    }

At queryString.count.
I have installed this with cocoapods.
Can you please help me?

@capimichi
Copy link
Author

Sorry my fault, old Xcode version.
You can close.

@Saifalip
Copy link

@capimichi
Hi i am also getting the same error.
My xcode version is 8.1
Can you tell me how you solve this error and which xcode u are using

@capimichi
Copy link
Author

@Saifalip
Hi,
i resolved the problem with this version of the pod:
pod 'SwiftHTTP', '~> 2.1.0'

My xcode version is: 8.1

Hope this help.

@Saifalip
Copy link

Saifalip commented Feb 28, 2018

@capimichi
Thanks for replying, But i am not getting how to get the pod 'SwiftHTTP', '~> 2.1.0' using terminal
could you please help
screen shot 2018-02-28 at 1 28 19 pm
screen shot 2018-02-28 at 1 28 41 pm
Here i am getting errors

@capimichi
Copy link
Author

capimichi commented Feb 28, 2018

Edit your Podfile like this:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'MyMoneyV2' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyMoneyV2
  pod 'PKHUD', '~> 4.0'
  pod 'SwiftHTTP', '~> 2.1.0'
  pod 'GRDB.swift', '~> 0.8'
  #pod 'SwiftChart', '~> 0.6.0'
  pod 'Charts', '3.0.0'
  pod 'Eureka', '~> 3'
  target 'MyMoneyV2Tests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'MyMoneyV2UITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

In particular this line:
pod 'SwiftHTTP', '~> 2.1.0'

And then run:

pod install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants