Creating an iPhone app

Senin, 21 November 2011

Requirements:

  • Mac OSX (if you have windows, try this)
  • XCode IDE (3.x +)
  • Jailbroken iPhone or iPod Touch

Introduction:

This guide will teach you how to make and transfer an iPhone application. It will not teach you about Cocoa or Objective C, and you do not need to know it to follow this guide.



Getting Started:

Open up XCode. You can do this by searching for it in Spotlight (the magnifying glass icon on the menu), or navigating to /Developer/Applications.

Either click Create New XCode Project in the welcome screen, or File -> New Project.... Under iOS select Application then View-based Application.

Name the project First App and save it wherever.


Making The Application:

You should now have a project screen that looks like this:
 Click the Build and Run icon. The iPhone simulator should start and give you a blank gray screen.
 Lets add some stuff to the app. Quit iPhone Simulator and double click the MainWindow.xib file, Interface Builder should pop up.
 Search for View in the Library box, and drag it to the iPhone window.

Now search for Label in the Library box, and drag it to the iPhone window. Change the text to My First App.
Save the file File -> Save. If you want to change the background color, etc. you can try messing around with Interface Builder.

To make sure it works, go back to XCode and click the Build and Run icon again. Your app should look similar to this:
If you want to add an icon, then make a 57 X 57 png file named Icon.png. Then add it to your project by selecting Project -> Add To Project.

Releasing The App:

Right now, our app only works with iPhone Simulator. We will have to do some extra stuff to make it able to run on your iPhone/iPod Touch.

In Xcode, click File -> New File.... Under iOS select Code Signing then Entitlements. Leave the settings to defaults.





Create a new Certificate. To do this, open up Keychain Access. You can search for it in Spotlight, or find it under /Applications/Utilites. Click Keychain Access -> Certificate Assistant -> Create a Certificate.... In the wizard that pops up change the name to iPhone Developer, change the Certificate Type to Code Signing, and check the box that says Let me override defaults.
Click continue and leave everything to defaults except for the email address field (blank it out).

Make XCode use your certificate. To do this open up Terminal. You can search for it in Spotlight, or find it under /Applications/Utilities. Copy and paste the following and press enter. It will ask you for your administrative password.
Note: For security reasons, your password will not be shown when you type.
sudo /usr/bin/sed -i .bak 's/XCiPhoneOSCodeSignContext/XCCodeSignContext/' /Developer/Platforms/iPhoneOS.platform/Info.plist
Then restart XCode.

After opening up your project in XCode again (File -> Open - PATH_TO_PROJECT/First App.xcodeproj), click the top left dropdown list and change the values as follows:


  • Change Simulator to Device
  • Change Debug to Release
Next click Build -> Build. If you look under /PATH_TO_PROJECT/build/Release-iphoneos/ you should see the First App application. I will be referring to this as PATH_TO_APP.

Final Product:

Project Files:

Download Project

You can find the app under /build/Release-iphoneos/.
Share this article on :

1 comments:

allen perumal mengatakan...

Thanks for sharing, I will bookmark and be back again


iPhone Apps Development

Posting Komentar

 
© Copyright 2010-2011 yeah All Rights Reserved.
Template Design by Herdiansyah Hamzah | Published by Borneo Templates | Powered by Blogger.com.