Skip to content

Instantly share code, notes, and snippets.

@texel
Created July 22, 2010 03:32
Show Gist options
  • Select an option

  • Save texel/485528 to your computer and use it in GitHub Desktop.

Select an option

Save texel/485528 to your computer and use it in GitHub Desktop.
NSURLConnection.connectionWithRequest(url_request, delegate: ConnectionDelegate.new do |d|
d.success { |data| some_object.do_something_with_data(data) }
d.failure do |data, error|
# we can do something more complex here... and we don't have to look in the delegate class!
some_other_object.do_something_with_error(error)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment