SUMMARY

This chapter explored the various ways you can consume a Web service in your iOS applications: SOAP, HTTP GET, HTTP POST, and JSON. You also learned how to extract data from an XML document. Finally, you learned how to integrate Twitter into your application using the new API in iOS 5.

EXERCISES

  1. Name the four ways in which you can consume a Web service in your iOS applications.
  2. Name the three key events you need to handle when using the NSURLConnection class.
  3. Describe the steps with which the NSXMLParser class parses the content of an XML document.
  4. Name the class new in iOS 5 for composing Tweets.

    Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Ways to consume a Web service SOAP 1.1/1.2, HTTP GET, HTTP POST, and JSON
Formulating a URL request Use the NSMutableURLRequest class.
Establishing a URL connection Use the NSURLConnection class.
Class for storing byte buffers Use the NSMutableData class.
Events fired by the NSURLConnection class connection:didReceiveResponse:connection:didReceiveData:connection:didFailWithError:connectionDidFinishLoading:
Parsing XML content Use the NSXMLParser class.
Events fired by the NSXMLParser class *parser:didStartElement:namespaceURI:qualifiedName:attributes:*parser:foundCharacters:*parser:didEndElement:namespaceURI:qualifiedName:
Parsing JSON strings Use ...

Get Beginning iOS 5 Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.