Creating your first iOS app

 by A-Nony-Mus
Featured
Looking around this site, it occurred to me that there weren't many 'ibles on programming the iOS platform, so I thought I'd fix that deficit. This is a simple "hello, world!" app for iPhone (or iPod Touch, or iPad). This 'ible will also serve the purpose of helping others become familiar with the IDE known as Xcode, which is what you need if you want to program for the iOS platforms.
 
Remove these adsRemove these ads by Signing Up

Step 1: Get Xcode

If you already have Xcode, you can skip this step.

If you want to develop apps for iOS, you need the SDK, which is provided with Xcode. Xcode only runs on Mac OS X (yes, Apple is doing that on purpose), so if you are running a windows (or linux, or pretty much any non-Mac OS X) operating system, you have a couple options:

1. Get a mac, by far the easiest, but it can be rather expensive.

2. Find a friend with a mac, if they are nice, they'll let you use it for programming, you should warn them, however, that programming takes a long time.

3. Give up, Those are your legal options, there are some other options that are either illegal, or are in the gray area (meaning it's debatable whether or not it is illegal), so I am not mentioning them, you want to know them, find them yourself, I won't be responsible.

Now that's settled, onto the IDE. Go to the mac app store (available in mac os x 10.6.8 and later) and search Xcode. It's the first option, click on it. Download it, it's a lengthy download, ~4 Gb, so if you have a slow internet connection you may want to consider doing something else while it is downloading.
1-40 of 60Next »
imjohnbo says: Mar 28, 2013. 7:40 AM
Great tutorial. But, when I click run, the iOS Simulator screen comes up with a white screen, no label. I've followed your directions except for not using the viewDidUnload function, as it's deprecated in iOS 6.1. Any ideas? Thanks!
A-Nony-Mus (author) in reply to imjohnboMar 28, 2013. 8:39 AM
I work on a MBP, so I only have 15 inches of screen size. Ever since apple announced the new iPhone screen size, I have to scroll up and down, like I would with a page, if I want to see the entire app.
perfo says: Aug 19, 2012. 1:36 PM
Hello, thanks for the ible.
Can the Xcode be run on an iphone or IPad? With a big screen and keyboard attached it could be an option I'm guessing. Second question is once you've written this app, how do you publish it? Say you have one of those super expensive MAC and wrote this app then how do you get it on to your Iphone and run it?
I'd like to see a simple app with a button that did something, i.e. turn the LED on and off just to see how you would interface with the iphones hardware.
Thanks again fella.
A-Nony-Mus (author) in reply to perfoAug 19, 2012. 2:39 PM
Unfortunately, to test the apps you write on your devices, you have to be a member of the paid developer program (US $100/year).
ThunderBow98 in reply to A-Nony-MusMar 5, 2013. 5:26 PM
Oh yea and one more thing. If I decide to create my own app and put it on the app store for a whopping $100, will the app be removed if I don't continue to pay the license?
perfo in reply to A-Nony-MusAug 19, 2012. 4:39 PM
Oh...no wonder it wasn't obvious. Thanks for replying.
ThunderBow98 says: Mar 4, 2013. 8:00 PM
Um just wondering but what programming language did you use in this tutorial? Thanks
A-Nony-Mus (author) in reply to ThunderBow98Mar 5, 2013. 6:28 AM
It was written in objective-c, an object oriented version of c.
ThunderBow98 in reply to A-Nony-MusMar 5, 2013. 5:21 PM
So wait this tutorial used objective-c?
iceng says: Sep 20, 2012. 12:40 AM
I did the  Hello World ! 
Now, can I mess with the RF output to unlock my car, Only My Car.
I don't want to sell or provide the Xcode to anyone.
Is this possible ??

A
carlmal says: Aug 20, 2012. 7:28 AM
Would be great if you could include how to get the app onto your device. Thanks for the instructable.
A-Nony-Mus (author) in reply to carlmalAug 20, 2012. 9:00 AM
Unfortunately (and I learned this the hard way), you need to be a part of the paid developer program (US $100/year) in order to put the app on your device.
MHaakansson in reply to A-Nony-MusAug 22, 2012. 12:55 AM
For your own device, connected with your iTunes, you don't need to be in the developer program - just connect the device for sync.
But if you want your app in the AppStore, you need to be in the program.
best regards
Martin
Zaphod Beetlebrox in reply to MHaakanssonSep 15, 2012. 6:36 AM
Is it jailbroken?
A-Nony-Mus (author) in reply to MHaakanssonAug 22, 2012. 3:22 PM
I had to join the program to put it on my device, but if you'd post an 'ible on how to do that, I'd love to be proven wrong.
zacker in reply to i_drank_whatAug 20, 2012. 5:17 AM
Its probably because most people today, no matter how much they say they want to help the world, will help themselves first... its all about the $$$ and the Ego. Sad really, this world could be so much cooler... Imagine if there was no BS out there? everyone got along, no one being snarky or cocky, you could actually have a good day, every day...lol
A-Nony-Mus (author) in reply to zackerAug 20, 2012. 8:54 AM
Just remember, in this economy, in order to help others, you have to have $$$ first.
perfo in reply to i_drank_whatAug 19, 2012. 4:59 PM
I am a Linux user and an android user and an Iphone user. They are for different things. I'm a fiddler so Linux and android are great but my wife wants things that work first time and that’s where apple comes in. Like so many things Apples strengths are its weakness. I'm forever downloading apps on the android market that freeze or simply just don't work as there's very little control but I haven't seen an Apple app (no doubt they exist) that didn't do what it said straight out of the tin with no messing. So like I said apple no good for me as I don't mind fiddling and actually like it but perfect for the wife. Would anyone learning how to write Hello world for the first time really fork out $100 just to test if it works? If you’re not going to put your new app on a device then I’m not really sure what the point is. I think if Apple just allowed you to put it on your own device but couldn’t go any further then this may encourage folk like me that have been programming for years and wouldn’t mind a crack at the IOS stuff but I aint gonna pay $100 for the privilege.
Zaphod Beetlebrox in reply to perfoSep 15, 2012. 6:34 AM
If you have a jailbroken ipod you can put it onto your own device easily. Or you should develop your apps on android instead, that way you can have it on your own device for free, and if/when it works you could pay the $25 to put it on the market.
championx5 says: Aug 20, 2012. 6:42 PM
Quick question, I'm currently making my own RPG with RPG Maker VX Ace and i'd like to know if there was anyway i could make it into an app?
Ragevortex in reply to championx5Aug 29, 2012. 12:24 PM
A-nony-mus
Nice Iabble for an app introduction mon

Championx5
In your case I recommend Construct 2 http://www.scirra.com/construct2
its originally free and when your "app" is ready then you may decide to use either of the licenses they offer. In my case I just upload the finish product as a web app to my server for testing up til i'm happy with it.

Cheers and happy hunting/programming/iabbling or whatever...-ing :)
A-Nony-Mus (author) in reply to championx5Aug 20, 2012. 6:45 PM
Don't know, never heard of that software before now. I know that unity has a way of making iOS apps, so it wouldn't surprise me if this did.
hojijoon says: Aug 22, 2012. 7:45 AM
very nice thank you bro!
zacker says: Aug 20, 2012. 5:22 AM
all that just to say Hello World? whats it take to make an actual app like these photo editing apps and such?
A-Nony-Mus (author) in reply to zackerAug 20, 2012. 9:06 AM
Apple has tons of sample code if you want to take a look at that and get the idea of the size of an average program.
remendab in reply to zackerAug 20, 2012. 6:11 AM
That is not all that much work - really. With much power comes much responsibility, meaning that there are many small things required just to get up and running, but once you are, running that is, the next steps are not that much more complex
zacker in reply to remendabAug 20, 2012. 7:09 AM
...like baby steps.. lol Thanks!
jschmukendorf says: Aug 19, 2012. 6:54 PM
Very nice introduction to writing an app! This could be the road to riches for someone with a good idea an a willingness to learn.

Thank you!!
Fugitive_Bill says: Aug 19, 2012. 1:58 PM
I'm not rich enough for 'i' stuff. I'll have to learn how program Android clones!!
Who's with me, lot's I'll bet!, erm a few maybe?!
MMI Studios in reply to Fugitive_BillAug 19, 2012. 5:12 PM
Read my post below... You don't need an "i" machine to develop for iOS... The author was more than a little inaccurate by telling everyone there is no "legal" way to develop for iOS without a Mac machine...
HandySun says: Aug 19, 2012. 3:47 PM
First of all, I have been modifying and making my own code for years now, and this makes sense to me. But from the perspective of someone who has never worked this code, it will make no sense at all to them.

I really suggest if you plan on doing more of these, you get WAY more in depth or just don't do it at all. You're just going to confuse and frustrate people who are new to programming for this reason.

If your instruction was pointed at people who know coding, then why on earth would you do something this basic? In this case it would have been better to make a simple button that turns the camera light on.
iFirefly says: Aug 19, 2012. 3:04 PM
Hey I look forward to reading this through and hope I can pick up some skills, so thanks in advance!

I did want to let everyone know that there is an alternative to Apple hardware so you can use cheaper Windows computers and run Mac OSX to program your iOS apps.

Its called "Hackintosh" and if you do an Internet search on that term alone, you will find the information necessary to determine which computer processor, video card and memory requirements to succeed. I have never done it myself, but have read several sites' worth and it seems fairly straightforward.
TimPayne says: Aug 19, 2012. 12:31 PM
Nice! Thanks for creating this Instructable.
MMI Studios says: Aug 19, 2012. 11:51 AM
Umm... There is a big inaccuracy in your ible... You should probably do a little more research before telling people such things... There are several LEGAL Windows based mobile development solutions that INCLUDE iOS... If you google "iOS development on Windows" the very first search result will be this: http://maniacdev.com/2010/01/iphone-development-windows-options-available/

It's a list of iOS dev solutions for Windows. I use one on this list, Titanium Studio by Appcelerator and it's great... It's an Eclipse based IDE... Also, if you have Flash of Flex CS5.5 or higher you can use the built-in iPhone Packager... Marmalade is another good solution: http://www.madewithmarmalade.com

It's actually quite easy to build a mobile web app using HTML5, CSS3, and JavaScript and package and deploy it to iOS... Regardless of platform, legally... The only part you NEED OS X for is to submit the app... But there are services that can do the submission for you...
MMI Studios in reply to MMI StudiosAug 19, 2012. 12:01 PM
I actually do most of my development in OS X myself... Not really using Xcode though... I primarily just program HTML5/CSS/JavaScript (along with a healthy dose of XML and JSON) in my editor of choice (SublimeText 2) and then package them for iOS... Don't really see much need to use a full featured IDE unless working on large enterprise project working with a nice sized team of developers... Another app worth taking a look at is Construct 2 by Scirra... It's for rapid HTML5 game development... You can take the output of that and package it for mobile, including iOS...
gbeltrao says: Aug 19, 2012. 10:49 AM
If you know HTML5 there's an online app that allow you to simulate iOS based devices and save it as an app for iPhone, iPad, etc. http://www.electricplum.com/studio.aspx
gbeltrao in reply to gbeltraoAug 19, 2012. 10:53 AM
Correction: It's a desktop application, not an online app as I posted.
ricardouvina says: Aug 16, 2012. 6:44 AM
Nice! I have been looking for an instructable like this for weeks, thank you!
A-Nony-Mus (author) in reply to ricardouvinaAug 16, 2012. 9:02 AM
No problem. Any other iOS programming tutorials you want to see?
arduinoarts in reply to A-Nony-MusAug 19, 2012. 10:21 AM
Simple HTML app with geolocalization? Lime native app that pulls gps localization and writes it down on annhtml?

Thanks!
1-40 of 60Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!