# Developing for the iPhone. What to learn?

**URL:** <https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471>\
**Category:** In My Humble Opinion\
**Created:** [August 10, 2008, 3:12am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471 "2008-08-10T03:12:33Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunspace](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sunspace/32/1250_2.png) [@Sunspace](https://boards.straightdope.com/u/Sunspace)\
**Post date:** [August 10, 2008, 3:12am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/1 "2008-08-10T03:12:33Z")

</div>

Let’s say I have an idea for a useful little program for the iPhone.

I have a good idea of what goes on in computers, but I don’t have a lot of programming experience beyond, say, noodling around with C years ago. I know there’s a free downloadable “iPhone software development kit” and I know that there’s a set of developer tools that come with Macs these days, but I have no idea how to use them. I have a Mac.

What do I need to learn in order to program the iPhone, and what order do I need to learn it in?

---

<div class="post-metadata">

**Author:** ![atomicbadgerrace](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@atomicbadgerrace](https://boards.straightdope.com/u/atomicbadgerrace)\
**Post date:** [August 10, 2008, 3:35am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/2 "2008-08-10T03:35:47Z")

</div>

[QUOTE=Sunspace]  
I know there’s a free downloadable “iPhone software development kit”

…

What do I need to learn in order to program the iPhone, and what order do I need to learn it in?  
[/QUOTE]

Well, first, you need [$99 for the standard progam SDK](http://developer.apple.com/iphone/program/).

ETA: Although the SDK is free to download, it costs to be able to load anything onto the hardware.

Also, the [Wiki entry](http://en.wikipedia.org/wiki/IPhone_OS#iPhone_SDK) has some good info on the basics.

---

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [August 10, 2008, 3:53am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/3 "2008-08-10T03:53:58Z")

</div>

I believe that Mac principally uses [Objective-C](http://en.wikipedia.org/wiki/Objective-C), so you would probably want to learn that. Though straight C might be fine (I really have no idea).

---

<div class="post-metadata">

**Author:** ![Sunspace](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sunspace/32/1250_2.png) [@Sunspace](https://boards.straightdope.com/u/Sunspace)\
**Post date:** [August 10, 2008, 4:02am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/4 "2008-08-10T04:02:40Z")

</div>

Okay, I’ve signed up as a “registered iPhone developer”. 🙂 Apple sent me a confirmation email, I followed a link to their developer pages and logged in, and I’m presented with a welcome page of links for the SDK, for tutorials, for all kinds of things. Now let’s see whether I can go from the absolute beginning using these tools and tutorials.

(Incidentally, the SDK is around 1.25 gigabytes. Good thing I cleared all that stuff out of my hard drive…)

---

<div class="post-metadata">

**Author:** ![TimeWinder](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@TimeWinder](https://boards.straightdope.com/u/TimeWinder)\
**Post date:** [December 30, 2010, 9:53am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/6 "2010-12-30T09:53:26Z")

</div>

> [@Sage\_Rat](#):
>
> I believe that Mac principally uses [Objective-C](http://en.wikipedia.org/wiki/Objective-C), so you would probably want to learn that. Though straight C might be fine (I really have no idea).

Objective-C is a superset of C: basically SmallTalk syntax dropped into the C language to allow the type of object oriented programming they need. If you know C and the basics of object-oriented programming, it takes about 3 hours to come up to speed in Objective-C, and about 3 days to be an expert (the language is really small). If you prefer C++, the same extensions work there.

The unpaid developer kit comes with a simulator for your Mac, so you don’t need to spend money to try it out.

Assuming you have basic programming knowledge, the biggest hurdles are Interface Builder (the GUI designer), and particularly the interface between it and the programming language: views, view controllers, other controllers, and the like. This is far harder than learning Objective-C itself, and since it controls what actually appears on the screen, it can be hard to debug. I strongly recommend getting a book that comes with example code so you can start from a working model for your first app (there are also working templates in XCode that will get you started, but they’re “empty shells”).

I recommend [this book](http://www.amazon.com/iPhone-Programmers-App-Driven-Approach-Developer/dp/013705842X/ref=sr_1_1?ie=UTF8&s=books&qid=1293702467&sr=8-1) for novices with a little programming background.

Note that if you like it, programming for your Mac is the same language and many of the same libraries. The user interface layer is different (UIxxx vs. NSxxx), but uses many of the same concepts, although the Mac Interface Builder connections are much more sophisticated. There’s some sense in starting out with Mac programing, then moving to iOS: the cannonical reference there is [this](http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619/ref=sr_1_1?ie=UTF8&s=books&qid=1293702647&sr=1-1), although it’s getting a little out of date unless there’s a newer edition. You’ll be able to move a lot of your code from one environment to the other, so you can use a Mac version as a sort of prototype for much of your non-UI code.

---

<div class="post-metadata">

**Author:** ![The\_Niply\_Elder](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@The\_Niply\_Elder](https://boards.straightdope.com/u/The_Niply_Elder)\
**Post date:** [December 30, 2010, 5:47pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/7 "2010-12-30T17:47:01Z")

</div>

Also be aware that Stanford University has posted the entire class lectures of iphone App Programming from spring 2009 onto iTunes U. I have downloaded that to my iPad and would highly recommend that.

---

<div class="post-metadata">

**Author:** ![WarmNPrickly](https://avatars.discourse-cdn.com/v4/letter/w/d78d45/32.png) [@WarmNPrickly](https://boards.straightdope.com/u/WarmNPrickly)\
**Post date:** [December 30, 2010, 10:48pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/8 "2010-12-30T22:48:07Z")

</div>

> [@atomicbadgerrace](#):
>
> Well, first, you need [$99 for the standard progam SDK](http://developer.apple.com/iphone/program/).
> 
> ETA: Although the SDK is free to download, it costs to be able to load anything onto the hardware.
> 
> Also, the [Wiki entry](http://en.wikipedia.org/wiki/IPhone_OS#iPhone_SDK) has some good info on the basics.

The great thing about this, is that you can do all of your programing for free, and only pay the fee once you actually have something you want on your phone. That way, you don’t blow your money on something that you never get around to finishing. That’s good for people like me that are easily distracted.

The programming environment is extremely advanced. I only wish I had someone to explain what all those crazy commands the gui environment generates are.

---

<div class="post-metadata">

**Author:** ![Sunspace](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sunspace/32/1250_2.png) [@Sunspace](https://boards.straightdope.com/u/Sunspace)\
**Post date:** [December 30, 2010, 11:36pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/9 "2010-12-30T23:36:24Z")

</div>

Thanks for the replies, everyone. I’d forgotten that I posted this thread. 🙂

---

<div class="post-metadata">

**Author:** ![TimeWinder](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@TimeWinder](https://boards.straightdope.com/u/TimeWinder)\
**Post date:** [December 30, 2010, 11:56pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/10 "2010-12-30T23:56:10Z")

</div>

> [@WarmNPrickly](#):
>
> I only wish I had someone to explain what all those crazy commands the gui environment generates are.

_IBOutlet_ (prepended to instance variable declarations) is basically a #define to nothing: it’s just a marker for InterfaceBuilder that this particular variable should be visible (“have an outlet”) in the GUI construction tools so it can be wired up to things visually.

_IBAction_ (the return type of various functions) is a synonym for “void”, meant to tell the GUI designer that the particular function carries the signature of an action method, i.e. it’s a void function that takes only a “(id)sender” as an argument. These are functions that the Interface Builder can “wire up” to an action: i.e they implement the response to a button click, value change, menu command, etc. Again, marking this function this way tells Interface Builder to let you use drag-and-drop from a menu command (say) to this function in order to have this function implement that menu command.

The .nib or .xib file (two different formats for the same thing) is where all this GUI wiring is hidden, along with things like view layouts and the set of objects available to the system.

The “App Delegate” created for you is primarily just a place for you to do initialization and shutdown: implement applicationDidFinishLaunching: or applicationWillTerminate: You can do other stuff here, more on the Mac than in the iPhone, for last-chance menu handling and the like.

It’ll usually make one or more view controllers and views for you. The views are the visual representation onscreen, for custom ones you can implement drawView: to do the actual drawing of the view. The view controllers are for initialization, placement, and relocation of the views, along with things like handling what happens when the screen rotates.

There will also be a main.m or main.mm file (Obj-C and Obj-C++, respectively) that contains the main() function, which you usually never have to touch (initialization should happen in the App Delegate).

---

<div class="post-metadata">

**Author:** ![Randy\_Seltzer](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@Randy\_Seltzer](https://boards.straightdope.com/u/Randy_Seltzer)\
**Post date:** [December 31, 2010, 12:05am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/11 "2010-12-31T00:05:44Z")

</div>

> [@Sunspace](#):
>
> Thanks for the replies, everyone. I’d forgotten that I posted this thread. 🙂

So? It’s been over two years: did you ever make your ap?

---

<div class="post-metadata">

**Author:** ![Sunspace](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sunspace/32/1250_2.png) [@Sunspace](https://boards.straightdope.com/u/Sunspace)\
**Post date:** [December 31, 2010, 12:12am UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/12 "2010-12-31T00:12:17Z")

</div>

> [@Randy\_Seltzer](#):
>
> So? It’s been over two years: did you ever make your ap?

My friend and I are still learning. It’s kind of been at the back of the shelf what with layoffs, moves, new girlfriends, new jobs, courses, exams, etc. But we’re going to do it, honest!

---

<div class="post-metadata">

**Author:** ![WarmNPrickly](https://avatars.discourse-cdn.com/v4/letter/w/d78d45/32.png) [@WarmNPrickly](https://boards.straightdope.com/u/WarmNPrickly)\
**Post date:** [December 31, 2010, 3:11pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/13 "2010-12-31T15:11:44Z")

</div>

Thanks **TimeWinder**. I’ve book marked this page for when I get back to programing. Since my wife has taken over the iPad for good, I’ll have to get my own.

I have a very work relevant app I want to write. Ironically, for all of the complaints about Apples closed architecture, it only works precisely because of it.

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [December 31, 2010, 3:18pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/14 "2010-12-31T15:18:08Z")

</div>

By the way, if anybody here wants to write apps that will work on an Iphone without using a Mac, check out [NS Basic/App Studio](http://www.nsbasic.com/app/). I took part in the Beta-test group, though I didn’t really have time to get into it as much as I wanted yet. It’s an IDE that produces HTML5/Javascript pages that can be imported to run locally as apps.

And they’ll run on Iphone/Ipad/Droid! (Plus Blackberry 5 I believe.)

---

<div class="post-metadata">

**Author:** ![minor7flat5](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/minor7flat5/32/258_2.png) [@minor7flat5](https://boards.straightdope.com/u/minor7flat5)\
**Post date:** [December 31, 2010, 4:08pm UTC](https://boards.straightdope.com/t/developing-for-the-iphone-what-to-learn/459471/15 "2010-12-31T16:08:40Z")

</div>

Why not take the free one-semester course from Stanford University?

[iPhone Application Development (Winter 2010)](http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=384233225) by Alan Cannistraro and Josh Shaffer

It is a video podcast of the Stanford lectures, complete with homework assignments, available for free via iTunes University. Grab them while you can—there are no promises as to how long a particular set of lectures will remain available.
