7 ms·
Ask HN: Experienced programmer, beginner to iOS (objective-C). Where to begin?
What is the quickest way for an experienced programmer to come up to speed on iOS?
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.
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.
- I am comfortable in C, C#, Python. I can write Javascript when needed for my web-apps.
- NO experience with Objective-C. Fairly comfortable with ANSI-C.
- I have written web-apps: HTML, CSS, JS as needed.
- I have written desktop apps: So, I am familiar with how to use available UI elements with code behind.
I see clutch.io, RubyMotion, MonoTouch as options too. Any feedback from folks on these?
- keiferski 14y agoStanford's course is often recommended. I just started going through it myself. http://itunes.apple.com/us/itunes-u/ipad-iphone-application-development/id473757255 http://itunes.apple.com/us/itunes-u/ipad-iphone-application-...
- div 14y agoStanford'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 14y agoFor 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 14y agoYes, 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 14y agoI 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
- architgupta 14y agoThanks for the heads-up on ARC. Not averse to managing memory :-)
- mikeash 14y agoIf you need to include those files in your project, you can just turn ARC off for them while leaving it on for the rest.
- Arcanum-XIII 14y agoYou can disable ARC for some or all part of your program, so lib compatibility is not a problem.
- octopus 14y agoI suggest you to do a search after iOS 5 on Amazon and check the comments before buying a book. I'd stay away from any of the Appress books on Objective-C, iOS, etc ... low quality of information and a lot of typos. Personally I don't have a preferred source and I tend to use Apple's documentation or tutorials from websites like: http://www.raywenderlich.com/ http://www.raywenderlich.com/ iOS is a moving target so it is difficult to find a good book on this.
- officialchicken 14y agoI'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 14y agoI 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.
- checker659 14y agoRead 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/conceptual/objectivec/objc.pdf* https://developer.apple.com/library/mac/documentation/cocoa/...
- reidmain 14y agoI 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-development/id473757255 http://itunes.apple.com/itunes-u/ipad-iphone-application-dev...). 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 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 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 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-Macros https://github.com/reidmain/Objective-C-Categories-and-Macro.... 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 14y agoThat'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 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.
- perezda 14y agoStart 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 http://cocoacontrols.com I wouldn't start with Arc. Especially since you're comfortable in C.
- BenSS 14y agoThe 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.
- enobrev 14y agoI 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 14y agoCan 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?
- Wilya 14y agoI'm not very familiar with how PhoneGap works, and how much it depends on you, but from the docs it seems you still need the classical toolchain. But anyway, if you want to save yourself some hassle, find something that can run Lion. XCode 4 doesn't run on older OS (or at least not easily), and most current docs are aimed at it (I'm not even sure older XCode versions cover the current iOS versions). So, you need at least something with a Core2Duo. Older Core Duo might work, I'm not sure. I have some old white Macbook (13" from 2009), who mostly does the job. Not blazing fast, but since I only use it for iOS development, it's enough.
- mikeash 14y agoMake 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_requirements http://en.wikipedia.org/wiki/OS_X_Mountain_Lion#System_requi... 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.
- enobrev 14y agoI 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.
- micro-ram 14y agoGoing down the same road myself. Here is my page of links (http://iosln.com http://iosln.com)
- speg 14y agoI 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_nerd_ranch_guide_nd_edition_ http://www.bignerdranch.com/book/ios_programming_the_big_ner... 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 14y agoAah thanks! Looks like many people like Big Nerd Ranch! I am going to spring the $22 then :)
- losethos 14y agoAll compiler structures are sitting in memory waiting to be used. The internal data-structure for compiled classes is available. It's not too bad. Just to make it interesting, I added meta-data to the C+ syntax. You can put format strings into the class definition and other data. Then, you can write code which uses the compiler data applied on members of a class. My thought was that switching files to work on resources is bad and the resource info should be in the source code class defintiin. DoForm() is cool. ClassRep() is cool. You know how operator overloading seems awesome to a novice, but only good for Vector or Complex data types, if you are not a retard? God says... C:\Text\DARWIN.TXT aves work energetically together with their masters in carrying them away to a place of safety. Hence, it is clear that the slaves feel quite at home. During the months of June and July, on three successive years, I watched for many hours several nests in Surrey and Sussex, and never saw a slave either leave or enter a nest. As, during these months, the slaves are very few in number, I thought that they might behave differently when more numerous; but Mr. Smith informs me that he has watched the
- gdubs 14y agoBig 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 14y agoARC's usage seems conflicted! :D
- gdubs 14y agoApple'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.
- 0xSina_ 14y agoStarted 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).
- codercowboy 14y agoI was more or less the same as you, Java instead of C#. Built some of the apps on http://www.codercowboy.com 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-Programmers/dp/0321832078/ref=sr_1_1?ie=UTF8&qid=1336371521&sr=8-1 http://www.amazon.com/The-iOS-Developers-Cookbook-Programmer... 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.