

Ask HN: Experienced programmer, beginner to iOS (objective-C). Where to begin? - architgupta

What is the quickest way for an experienced programmer to come up to speed on iOS?<p>Looking for recommendations on a good book, tutorials. Pointers to good repositories on github also appreciated. I have started reading open-source code from some apps.<p>I want to write an app which needs custom UI elements (going beyond XCode's available UI elements). An example: a flipboard like app. No game dev.<p>- I am comfortable in C, C#, Python. I can write Javascript when needed for my web-apps.<p>- NO experience with Objective-C. Fairly comfortable with ANSI-C.<p>- I have written web-apps: HTML, CSS, JS as needed.<p>- I have written desktop apps: So, I am familiar with how to use available UI elements with code behind.<p>I see clutch.io, RubyMotion, MonoTouch as options too. Any feedback from folks on these?
======
reidmain
I was two years out of school working on C# and WPF when I was tasked with
writing an iOS app. My first steps to gain knowledge of the
syntax/structure/etc of the language was to watch the Standford CS139p
lectures ([http://itunes.apple.com/itunes-u/ipad-iphone-application-
dev...](http://itunes.apple.com/itunes-u/ipad-iphone-application-
development/id473757255)). I only had to watch the first six or so before I
had a good knowledge of the language and the starting point of UIKit. From
that point I just started brute forcing it.

Reading Apple's documentation was the fastest way for me to ramp up and they
actually include a lot of really useful examples. Even lower level things like
CoreGraphics have some in depth examples which will probably be what you need
for your "Flipboard" like interactions.

Because I do so much iOS dev I have my own "library" I now use for every
project. But it was cobbled together over a couple years and inspiration was
taken from many open source projects.

I probably learned the most from Jeff Verkoeyen's GitHub projects, his Nimbus
framework being one of the best <https://github.com/jverkoey/nimbus>

If you need to make web requests in your app (which basically every app
should) ASIHTTPRequest is an interesting framework.
<https://github.com/pokeb/asi-http-request>. I took the idea behind this and
distilled it down to something that was much simpler which is what I needed.
ASIHTTPRequest is sorta the kitchen sink of web request clients.

If you need a relational database in your app, sqlite is a simple include
away. There are a lot of wrapper frameworks out there but I didn't use any of
them. I wrote my first app directly accessing the C API and then wrote my own
wrapper framework for it. Because I had never used SQLite before needed it in
iOS it helped me learn a lot more about it.

If you need to store username/password/token/etc for the love of god don't
make the novice mistake of saving to NSUserDefaults. Save to the Keychain
<https://github.com/reidmain/FDKeychain>

One thing I'd point you to is my collection of Categories and Macros that I
put into every project [https://github.com/reidmain/Objective-C-Categories-
and-Macro...](https://github.com/reidmain/Objective-C-Categories-and-Macros).
Specifically pay attention to FDIsNullOrEmpty, NSObject+PerformBlock,
UIView+Layout. I use these categories so much that I always include them in my
precompiled header file.

~~~
div
That's all good advice, but I'd like to point out that ASIHTTPRequest has been
abandoned for about a year now. I think most people have switched to using
AFNetworking (<https://github.com/AFNetworking/AFNetworking>) which came out
of Gowalla.

As a nice bonus, AFNetworking doesn't require you to implement delegates but
instead allows you to use blocks, which simplifies things somewhat.

~~~
reidmain
The delegates are exactly what I factored out of ASIHTTPRequest when I made my
own version. Good to see someone has taken the ball and ran with it.

------
speg
I am going through the exact same thing. Last weekend I decided iOS would be
my project for May and started digging in.

There is a TON of information out there. Too much. Most of it is outdated, and
while the Apple documentation is a great resource, it is just not structured
in a way for beginners.

Enter the Big Nerd Ranch.

[http://www.bignerdranch.com/book/ios_programming_the_big_ner...](http://www.bignerdranch.com/book/ios_programming_the_big_nerd_ranch_guide_nd_edition_)

I think I got the kindle version for $22. It is perfect. Just released a
little over a month ago, it uses Xcode 4.3. The first few chapters have no iOS
stuff as they bring you up to speed on Obj-C and from there you start building
the bases of iOS.

I love that they make you strip out all the code from the iOS templates and
make you do it yourself. It really is a structured learning experience rather
than just an information dump.

I'm only about 1/3 the way through so far - but so far it's been exactly what
I needed.

~~~
architgupta
Aah thanks! Looks like many people like Big Nerd Ranch! I am going to spring
the $22 then :)

------
checker659
Read the docs from Apple. Believe or not, they are the best resources for an
experienced developer. Start with the Objective-C 2.0 book/entry. Then, go
from there.

Of course, if you didn't say you were experienced, I'd have suggested that you
start with the (what now must be like a) gazillion different apress/o'reilly
books on the topic.

Good luck!

 _The
book:[https://developer.apple.com/library/mac/documentation/cocoa/...](https://developer.apple.com/library/mac/documentation/cocoa/conceptual/objectivec/objc.pdf*)

------
keiferski
Stanford's course is often recommended. I just started going through it
myself.

[http://itunes.apple.com/us/itunes-u/ipad-iphone-
application-...](http://itunes.apple.com/us/itunes-u/ipad-iphone-application-
development/id473757255)

~~~
div
Stanford's course is excellent. If you're starting out, watch a lecture a day
alongside any other reading / researching you do.

The nice thing about the Stanford course is that it covers a lot of ground,
ranging from good code design, to all the major Cocoa components, to details
about most of the important ios lifecycles.

------
octopus
For your level of experience I would go would go with Kochan - _Programming in
Objective-C_ 4th edition.

There is also a free course for iPhone programming from Stanford (video
lectures).

MonoTouch is a good alternative if you prefer to use C#, but you will need to
pay 99$/year to Apple + 399$ for Monotouch. The good thing is that you can
evaluate MonoTouch and pay after you are comfortable with the tool.

RubyMotion is too young to be used in a large application. Also learning Ruby
and Cocoa in the same time can be difficult. I think RubyMotion is a good fit
for an experienced Ruby programmer that wants to start coding on iOS. Another
potential problem with RubyMotion is that it is currently developed by a
single person, which can be problematic on long term.

That been said, muy advice is to go on the Objective-C route since you are
already comfortable with C. Objective-C is a small language and an experienced
C programmer can be up to speed in a matter of days.

The real challenge is in learning the iOS libraries and not the programming
language.

~~~
architgupta
Yes, the general opinion seems to be:

Use Objective-C with the new Automatic Reference counting mechanism.

iOS libraries - in your opinion - what are some good resources to get
familiar? (Google-fu results in a lot of links to wade through).

~~~
officialchicken
I can not agree with recommending ARC to anyone at this time; in this case
there is a ton of existing code out there which is incompatible with it. If
you are an experienced obj-c developer who's tired of writing boilerplate and
uses the static analyzer with LLVM - then go for it.

Learning to clean up after yourself is a life skill worth having. And besides,
there's always the -fobjc-arc flag for classes which use it.

EDIT: Every project seems to include: Reachability SBJson ASIHttp

And also commonly occurring: OpenUDID ZipKit NSLogger InAppSettingsKit (there
are others) Cocos2d/3d

~~~
Arcanum-XIII
You can disable ARC for some or all part of your program, so lib compatibility
is not a problem.

------
officialchicken
I'd say there's no quick way to do it, the message passing of obj-c is very
different than the event-based slots & signals programming you are used to.
And that's before the hell-which-is-InterfaceBuilder. Since you already
familiar with programming, I'd suggest the Big Nerd Ranch guides at
bignerdranch.com

Most online examples won't give you the details about the important stuff -
single inheritance vs. categories, delegates and message passing in the
runtime, extending a protocol, etc. You may see it in the code, but there
won't be any theory or reasoning behind it to help you.

As a side note, you can track your learning progress by how much you hate
XCode with specific examples of how it ruined your day.

Can't speak to clutch.io, but the other 2 just seem to get in the way of
someone who already knows Ruby, C#, and obj-c. Do you really need another
layer of abstraction if you want to learn something at a lower level?

~~~
jamesjn
I second the recommendation of the Big Nerd Ranch guides. They are excellent
for learning Objective-C and IOS.

I've been playing around with Ruby Motion for the past two days and since I am
pretty experienced with Ruby already, I'm finding it helpful for learning ios
concepts. However, if you don't have any experience with Ruby I would
recommend just starting with Objective-C and xcode.

------
gdubs
Big Nerd Ranch guides are indispensable. Written by someone who was involved
with NextStep very early on.

Watch the Wwdc videos, starting at 2010, and following with 2011.

Use ARC.

Pay attention to the Wwdc videos on core animation.

Spend time learning about delegates.

Don't shy away from Interface Builder.

Check the header files when documentation seems incomplete. They are a great
resource.

~~~
architgupta
ARC's usage seems conflicted! :D

~~~
gdubs
Apple's recommendation is to start using it today. Retain/Release patterns
_always_ took newcomers a long time to master, and it distracts from building
applications. In Apple's own words, it's a compiler's problem – shouldn't be
yours.

------
codercowboy
I was more or less the same as you, Java instead of C#. Built some of the apps
on <http://www.codercowboy.com> in a few weeks with help from this book, very
highly recommended:

The iOS 5 Developer's Cookbook by Erica Sadun

[http://www.amazon.com/The-iOS-Developers-Cookbook-
Programmer...](http://www.amazon.com/The-iOS-Developers-Cookbook-
Programmers/dp/0321832078/ref=sr_1_1?ie=UTF8&qid=1336371521&sr=8-1)

A few (three or four) zero-to-go chapters in about 50 pages, then entire
chapters dedicated on various chunks of the IOS objective-c library. Perfect.

------
perezda
Start with the Stanford course. It's the best free resource out there. Find a
local meetup. Go to a couple hackathons.

re: other comments -

Apple's docs aren't great, in fact I hate them. Haven't put my finger on why.

I like some of the controls at <http://cocoacontrols.com>

I wouldn't start with Arc. Especially since you're comfortable in C.

~~~
BenSS
The apple docs are pretty comprehensive. I think of it as you're not going to
learn English by reading a dictionary.

The specific example apps that apple provides that demonstrate one particular
thing are great though.

------
0xSina_
Started iOS dev about a year ago. Hvaent written dozens of apps some with very
custom UI elements. Don't bother with clutch.io/rubymotion/mono touch. Learn
the raw Objective-C/Cocoa-Touch APIs. Especially for something UI intensive
like flipboard. Check out Standford iOS programming lectures. They are on
Youtube and iTunes (for free).

------
micro-ram
Going down the same road myself. Here is my page of links (<http://iosln.com>)

------
enobrev
I keep getting stopped up at the first step: Buy an Apple Computer. If I can
ever build IOS apps on Linux, I may move on to step two.

~~~
mkopinsky
Can anyone specify the absolute minimum requirements I should be asking for if
I'm looking for a dev Mac on craigslist or the like?

As a (mostly) web developer there's a good chance I'd build most of my app in
HTML/CSS using something like PhoneGap and only do the final compile step on
the Mac. A) Does that sound like a good plan? B) Does that impact
significantly on the minimum system requirements?

~~~
mikeash
Make sure you get something that can run the 64-bit kernel, as this will be a
requirement for running Mountain Lion when it comes out this summer. You don't
want to be stuck on an older OS, as Apple quickly stops supporting them for
the latest developer tools. Which models support the 64-bit kernel is not
obvious, as it is _not_ the same thing as simply having a 64-bit processor.

A list of Macs that will probably support Mountain Lion is available here:

[http://en.wikipedia.org/wiki/OS_X_Mountain_Lion#System_requi...](http://en.wikipedia.org/wiki/OS_X_Mountain_Lion#System_requirements)

Beyond that, you want at _least_ 4GB of RAM, with 8GB or even 16GB preferred
(Xcode is a severe memory hog), especially if you get a spinning platter
instead of an SSD.

I would strongly recommend against something like PhoneGap. iOS users
generally don't appreciate non-native interfaces, and it will be extremely
hard to achieve the necessary level of polish with HTML/CSS. If you want to
use HTML, then you probably might as well just go straight to building a real
web app. If you want native apps, it's worth your while to use the native
language and tools.

~~~
mkopinsky
Thanks for the insight re: PhoneGap and native interfaces. Does the same apply
to Appcelerator (or similar)? It compiles to native, but does the interface
feel native or HTMLy? At some point I want to play around some, but that
requires buying a mac and an iThing, neither of which I have yet.

Re: system requirements - that sucks that I really need to have (moderately)
up to date hardware to do iOS development. On a PC I'd probably be fine with a
2004 Dell laptop with a fresh install of Windows. I guess this is my first
"welcome" to the walled garden.

~~~
mikeash
Reading up on it, Appcelerator gives you native UIs with non-native languages,
so it should be much better in that department. I'd still recommend using the
real thing, at least to learn.

Macs have changed a lot since 2004. Buy a Mac of that vintage and it's still a
PowerPC, no Intel chip. You can run iOS development tools on such a thing, but
they will be seriously old.

