Developing on iPhone (2): preparing the environment

In our previous post we talked about the main differences between developing web applications and native applications for our iPhone. In this article we will now go on to describe the first steps you must take to start programming your native applications with Objective C. For readers who have already developed native iPhone applications this will be trivial; however, other users may observe that it is rare to find good documentation or tutorials that explain how to start step by step. We will try to help these types of users in this way.

First of all, I want to warn you that the iPhone SDK distributed by Apple is only available for users with Mac OS X v10.5.4 operating system. That is, if you don't have a Mac with Leopard, and you want to be a professional iPhone developer, you know what you're up to. Steve's designs are inexcrutable ...

If you meet this essential requirement, you have to download the SDK, that is, the development environment. This consists of several programs among which we could highlight XCode, the IDE with which we will develop, Interface Builder, to generate the user interface of our applications, Instruments, to be able to evaluate performance characteristics and behavior of the devices (for example, remove accelerometer graphs) or the iPhone Simulator. The latter will help us to test our code in an iPhone emulation. Then we will talk about what we should do to test on our own iPhone.

The SDK is free to download at the Apple developer zone (in English, it works best in Safari). In order to access it, we must register as developers, and proceed to download the development kit. It weighs a lot (1.3 GB approximately), and it goes for version 3.1.1. A new version of the SDK is released for each new version of the iPhone firmware.

Once downloaded, it is installed by clicking on the link «iPhone SDK»:

And a classic installation wizard begins:

In principle we can choose what is selected by default and wait a few minutes for everything to install. It will ask you to close iTunes, by the way.

Once installed we have, as we have said, the SDK on our machine. That is, Xcode, iPhone Simulator, and other utilities. And now that? Now we can start programming. First of all I leave you a couple of very nice URL's:

  • [1] Apple sample code page (requires registration): https://developer.apple.com/iphone/library/navigation/SampleCode.html
  • [2] 31 days, 31 apps: appsamuck

They are pages where we can download example code, which from our point of view is the best option without a doubt… And as a button shows, we are going to download a simple example project. Of course, the 'Hello World' project from Apple's example codes (see the previous link [1]). The application simply lets you write a text, and presents it on the screen. The project itself consists of a ZIP that we will unzip in the location we want. Once downloaded we open the HelloWorld.xcodeproj file:

And this file is opened by our favorite IDE, XCode:

In the next article we will describe what each file represents, and where it is 'programmed'. In this post we are simply going to assume that we have been able to program this example from scratch (we will be able to in the future), and we are going to see the result in the iPhone simulator. To do this, we will simply click on the 'Build and go' button, the IDE will compile the sources, open the iPhone Simulator and we will see "our" application working:

The most attentive users may ask: what if I want to test on my own iPhone? This has undoubted advantages, since you make sure that the application really works, and you can see a real speed by connecting to a 3G or Wifi network ... as well as having very interesting applications such as the XCode Graphical Debugger or technical support.

Well, you have at least three options:

  1. To pay Apple 😉 Yes, yes, you can believe it, to test your application on your iPhone you have to pay, registering in the iPhone Developer Program (http://developer.apple.com/iphone/program/). There are two modalities: Standard, at € 99, ​​and Enterprise at € 299. I can already anticipate that in 99,99% of the cases you will need the cheap version, Standard. The Enterprise is intended for large corporations (more than 500 employees) who want to create proprietary applications in intranet environments. The Standard is enough to be able to upload applications to the AppStore (if they are approved, of course), make distributions of your application without going through the AppStore (via URL or email) up to 100 iPhones, etc.
  2. Jailbreak your iPhone, although we all know that in the long run this is an option for seasoned users ... On the internet there are several references to how to solve this, for example this o This other.
  3. Find a partner who is already registered in the program and try his ... the truth is that there is no major problem in paying for a license among several. The only issue is that the certificate to sign the code is nominal, and you must have good confidence so that issues do not occur as happened to the founders of Facebook 😉

Well, there we leave it. Until the next class, if this is not enough for you, you can try to download more example projects and take a look at the code. Until the next article!


Follow us on Google News

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   random said

    I am really interested in your series of articles to develop in Objective-C. Go ahead and good luck !!!

    A.

  2.   Javier Echeverria Usua said

    Thank you, I hope I do not disappoint you!

  3.   TechnopodMan said

    FERPECT !! Keep it up ... 😉

    regards

  4.   adrian said

    you have at least three options

    I only see 2 🙂

    Very good articles, it would not be bad to go a little more in depth and even an introduction to Objective-C.

    Greetings.

  5.   Javier Echeverria Usua said

    Oops I missed the third one! Find you a compi who is a registered Developer and try it on his iPhone (that's what I do) 😉

    Going into detail, everything will work ... the next post will probably explain in detail what each component of HelloWorld does ... of course explaining Objective C topics

  6.   Limbo said

    Very good, we look forward to the next deliveries.
    Congratulations.

  7.   iphonealdia said

    Very good post!

    New blog to keep you up to date on your favorite phone!
    click on my name!

  8.   hangover said

    Has anyone tried to mount leopard on a vmware? I am not able, as it gives me an error when mounting the leopard image.

    Someone give me a hand?

    Thank you.

  9.   pavel franco marin said

    Hello, very good post ... just like the others on the subject. However I have a little doubt; Let's see, what happens is that I need to do a development for an iPhone, but I work on Windows XP, I wonder if it is not possible to work on this OS, I say it because of what you say at the beginning of the post that the SDK only works can work on Mac OS; also, there I saw a comment which spoke of mounting a Mac OS on a virtual machine, in the same way I will try, but in case I can not, because I anticipate the events a bit, as the law is well known in these cases of Murphy always goes out to relusir ... hehe ...

    Well, I hope you can lend me a hand and in advance thank you very much for the collaboration provided.

    See you soon and success.

    Greetings.