Developing iPhone Applications – 5 things you should know
So you think you want to develop software applications for the iPhone. Sure, this is no big deal, you’ve been writing Java or C# for years now. You transitioned to those languages from Visual Basic 6. Heck, you even took C++ in school. You’re certainly not the type intimidated by learning a new language. Really, how different can Objective C really be? Any of this sound familiar? It sure does to me, since that’s exactly what went through my head prior to writing my first iPhone application. I quickly, and sometimes not so quickly, found that the jump from Java to Objective C was not as seamless as originally anticipated. So, from my pain, and for your benefit, here is a list of 5 things I wish I knew going into iPhone development. I have ordered them from merely annoying (or amusing, depending on your disposition) quirks of the language all the way to massive paradigm shifts that will change the way you code. No, I cannot overstate that last part enough. And no, I swear I am not a scare-monger…
So, now to the list:
1. Say goodbye to the “dot operator”.
Consuming XML Web Services in iPhone Applications
Communicating with the outside world is one of the ways to make your iPhone applications interesting and useful. This is especially true today where they are so many web services that provide so much useful functionality. However, consuming web services in iPhone is not for the faint-of-heart. Unlike other development tools (such as Microsoft Visual Studio), Xcode does not have built-in tools that make consuming web services easy. Everything must be done by hand and you need to know how to form the relevant XML messages to send to the web services and then parse the returning XML result.
This article will give you a good understanding of how to communicate with XML web services from within your iPhone application, and the examples will provide a solid foundation for consuming other web services in your own projects.
Consuming Web Services
![]() |
|
| Figure 1. IPToCountry Web Service: This web service exposes two web methods. | |
Before beginning an Xcode project to consume a web service, examining a real web service to see the different ways you can consume is worthwhile. My favorite example is to use an ASMX XML web service created using .NET. For discussion purposes, here’s a look at a web service called IPToCountry, which lets you supply an IP address and returns the country to which the IP address belongs.



