views:

161

answers:

8

Thinking about learning Objective-C I've a background in Java and haven't thought about learning another language yet. The main goal is to eventually get into iPhone and iPad software development, but it's still early days.

My main question is: should I start with C or just jump straight into Objective-C since I'm already familiar with OOP?

Also any books or websites would also be very helpful :)

And BTW I'm on Windows and won't have my Mac for a few weeks.

+1  A: 

I knew C# very well before I got into Objective-C and it was a fairly smooth transition. So I'd definately recommend starting learning Objective-C straight away.

The most important thing to get used to are Memory Management using reference counting and the conventions around it. This is a little inconvenient if you come from a GC background, but in general it's very straightforward.

An important design concept that is taken advantage of in a lot of different places is that objects communicate passing messages instead of calling methods on each other. But other than that you will find all the usual OOP constructs in place. The framework functionality

There's no point in learning C to get started with iOS Development. However it's never bad to know C, especially if you've got performance critical sections. But you can still decide to learn C when that becomes necessary.

Johannes Rudolph
+3  A: 

I'd learn the basics of C first. Objective-C is essentially a super-set of C, so it would be very helpful to have a grounding in C first. That said, programming in Objective-C is quite a bit different; the OO bits aren't just a bolt-on, but really change how common tasks are (or ought to be) accomplished. I'd recommend you at least gain an understanding of the low-level C parts, but keep in mind that the idioms aren't quite the same.

EDIT: After reading mvds's comment, I thought I should point out that C and Objective-C often use significantly different memory-management idioms, neither of which resembles Java's.

Thom Smith
++votes for C. And as for Objective-C I would add: focus on memory management from the start! Especially with a java background.
mvds
Johannes Rudolph
What about Core frameworks which are straight-up C?
Santa
A: 

There is a very good tutorial series on YouTube:

About Objective-C: http://www.youtube.com/watch?v=1Xqn5IHbusA (the same user also offers an iPhone programming tutorial, look for it).

From what I've seen you can dive right into Objective-C, there is not much sense starting C first.

mathume
+1  A: 

The most useful resources are the Apple documentation & guides.

iOS Application Programming Guide

Sheehan Alam
+1  A: 

I found Objective-C pretty confusing coming from a C++ and Java background. Make sure you read this carefully:

http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer

The syntax from Objective C is pretty unique to all active languages today as it is used from NextStep.

A: 

If you know Java then Objective-C should be know problem. I know, because that's how I did it. I'd just jump right into Objective-C and it's just a matter of how does Objective-C do things that Java does. In java, where you'd do object.doMethod(arg) you just do [object doMethod:arg]. One big difference though, is dealing with memory management. That, and there's 2 files per class.

Kurbz
A: 

These are two good articles introducing Objective-C from a Java perspective:

Objective-C for Java Programmers http://www.informit.com/articles/article.aspx?p=1568732 http://www.informit.com/articles/article.aspx?p=1571983

Felixyz
A: 

When I went from Java to Objective-C, this document was a godsend:

http://www.mecodegoodsomeday.com/ObjectiveCRef.pdf

aepryus