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

Cocoa error 3840 #36

Closed
stefanvermaas opened this issue Nov 14, 2013 · 0 comments
Closed

Cocoa error 3840 #36

stefanvermaas opened this issue Nov 14, 2013 · 0 comments

Comments

@stefanvermaas
Copy link

Hi,

Currently I'm using AFMotion, but the put request fail and I'm not quite sure why it fails. AFMotion/AFNetworking gives me the cocoa error 3840, but I don't understand why, because I'm converting everything to a JSON object.

The client is created using a shared client.

Any idea on this?

  # Update an existing model
  def update( data, remote = false )
    data_attributes = BW::JSON.generate( data.attributes )
    item = if remote
      @client.put("#{@collection}/#{data.id}", data_attributes) do |res|
        p res
        if res.success?
          res.object
        end
      end
    else
      @model.where(:id).eq(data.id).first.update_attributes(data)
    end
  end
#<AFMotion::HTTPResult:0xa4df2f0 @operation=#<AFHTTPRequestOperation:0xe1d4570> 
@object=nil 
@error=#<NSError:0xa518f40, description="The operation couldn’t be completed. (Cocoa error 3840.)", code=3840, domain="NSCocoaErrorDomain", userInfo={"NSDebugDescription"=>"JSON text did not start with array or object and option to allow fragments not set."}>>

These are the Ruby Gem versions I'm using:

Using rake (10.1.0) 
Using ProMotion (1.0.4) 
Using i18n (0.6.5) 
Using multi_json (1.8.2) 
Using activesupport (3.2.15) 
Using claide (0.3.2) 
Using json_pure (1.8.1) 
Using nap (0.5.1) 
Using cocoapods-core (0.27.1) 
Using cocoapods-downloader (0.2.0) 
Using colored (1.2) 
Using escape (0.0.4) 
Using open4 (1.3.0) 
Using xcodeproj (0.14.1) 
Using cocoapods (0.27.1) 
Using motion-cocoapods (1.4.0) 
Using motion-require (0.0.7) 
Using afmotion (2.0.0) 
Using bubble-wrap (1.3.0) 
Using motion-support (0.2.5) 
Using motion-testflight (1.5) 
Using motion_model (0.4.6) 
Using sugarcube (1.3.5) 
Using teacup (2.1.13) 
Using sweettea (0.6.0) 
Using bundler (1.3.5) 

We're currently not using the latest cocoa pods, because the latest version of cocoa pods conflicts with some other gems.

Cheers.

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

1 participant