Welcome to the world of iPhone programming! This post   shows that you are fascinated with the idea of developing your own iPhone (and iPad) applications and want to join the ranks of the tens of thousands of developers whose applications are already deployed in the App Store. So Once again welcome to this iphone world. You will learn lots of interested things here. It will make interested things on you.....

1. Download & Install the Iphone SDK


To develop for the iPhone, you fi rst need to sign up as a registered iPhone developer at http://developer.apple.com/iphone/program/start/register/. Registration is free and provides you with access to the iPhone SDK (software development kit) and other resources that are useful for getting started.

At the time of writing, iOS (the iPhone OS) 4 is supported only on the iPhone and the iPod touch. The iPad still runs on the older iPhone OS 3.2 version. However, the iPhone SDK 4.0 supports both iPhone and iPad development. Because the iPad also uses the iPhone OS, throughout this book you will often see the term “iPhone” used.

After signing up, you can download the iPhone SDK.


Before you install the iPhone SDK, make sure you satisfy the following system requirements:

1.  Only Intel Macs are supported, so if you have another processor type (such as the older G4 or G5 Macs), you’re out of luck.

2.  Your system is updated with the latest Mac OS X release.

An actual iPhone/iPad is highly recommended, although not strictly necessary. To test your application, you can use the included iPhone Simulator (which enables you to simulate an iPhone or an iPad). However, to test certain hardware features like GPS, the accelerometer, and such, you need to use a real device.

When the SDK is downloaded, proceed with installing it. Accept a few licensing agreements and then select the destination folder in which to install the SDK.


If you select the default settings during the installation phase, the various tools will be installed in the /Developer/Applications folder.

2. Components Of The Iphone SDK:


The iPhone SDK includes a suite of development tools to help you create applications for your iPhone, iPod touch, and iPad. It includes the following:

1.  Xcode — Integrated development environment (IDE) that enables you to manage, edit, and debug your projects
2.  Dashcode — Integrated development environment (IDE) that enables you to develop webbased iPhone and iPad applications and Dashboard Widgets. Dashcode is beyond the scope of this book.
3.  iPhone Simulator — Provides a software simulator to simulate an iPhone or an iPad on your Mac.
4.  Interface Builder — Visual editor for designing user interfaces for your iPhone and iPad
applications
5.  Instruments — Analysis tool to help you both optimize your application and monitor for
memory leaks in real time

3. Xcode


To launch Xcode, double-click the Xcode icon located in the /Developer/Applications folder. Alternatively, go the quicker route and use Spotlight: Simply type Xcode into the search box
and Xcode should be in the Top Hit position.

Xcode Welcome screen.


Using Xcode, you can develop different types of iPhone, iPad, and Mac OS X applications using the various project templates.


Each template gives you the option to select the platform you are targeting — iPhone or iPad.

The IDE in Xcode provides many tools and features that make your development life much easier. One such feature is Code Sense, which displays a popup list showing the available classes and members, such as methods, properties, and so on.

4. Iphone Simulator:


The iPhone Simulator, is a very useful tool that you can use to test your application without using your actual iPhone/iPod touch/iPad. The iPhone Simulator is located in the /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications folder. Most of the time, you don’t need to launch the iPhone Simulator directly — running (or debugging) your application in Xcode automatically brings up the iPhone Simulator. Xcode installs the application on the iPhone Simulator automatically.


The iPhone Simulator can simulate different versions of the iPhone OS.



In addition, the iPhone Simulator can simulate different devices — iPad, iPhone (3G and 3GS), and iPhone 4.



The iPhone Simulator simulating the older iPhone 3G/3GS and it simulating the iPad.


5. Uninstalling Applications from the iPhone Simulator


To uninstall (delete) an application, execute the following steps:



1 Click and hold the icon of the application on the Home screen until all the icons start wriggling. Observe that all the icons now have an X button displayed
on their top-left corner.
2 Click the X button (see Figure 1-13) next to the icon of the application you want to uninstall.
3 An alert window appears asking if you are sure you want to delete the icon. Click Delete to confirm the deletion.

6. Interface Builder


Interface Builder is a visual tool that enables you to design the user interfaces for your iPhone/iPad applications. Using Interface Builder, you drag and drop views onto windows and then connect the various views with outlets and actions so that they can programmatically interact with your code.

7. instruments


The Instruments application enables you to dynamically trace and profile the performance of your Mac OS X, iPhone, and iPad applications.



Using Instruments, you can do all of the following:

1.  Stress test your applications
2.  Monitor your applications for memory leaks
3.  Gain a deep understanding of the executing behavior of your applications
4.  Track diffi cult-to-reproduce problems in your applications

Categories:

Leave a Reply