Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cocoa/Xcode tutorial for C# developer

I've been developing for C# for a while now using MS's free development too (Visual C# Express) and also used it for web development in ASP.NET.

Now, I don't know much, but I know it's virtually impossible to develop in C# on the Mac. Mono is just not up to it. So I'd love to learn Cocoa but I don't know Obj-C, or even, for that matter, C. But I do have a fair amount of programming experience. My question is, is there a tutorial out there for Obj-C/Xcode geared towards someone like me, a long time programmer but newbie to C/Obj-C?

Cheers
-gorman

MacBook Pro 15.4", Mac OS X (10.4.7), 1.5GB RAM, 1.83GHz Core Duo

Posted on Jan 15, 2007 1:26 AM

Reply
9 replies

Jan 15, 2007 6:03 AM in response to Morgan Harris

How do you do C# without knowing C? Don't answer, that's a rhetorical question.

To learn the basics of Objective-C, read the PDF book that comes with the develoepr tools. The title seems to change, but it usually includes the words "Objective-C Language."

As someone coming from a C background who has struggled to really "get" C++, I was at first jarred by the appearance of the square brackets that dominate ObjC (but you rarely see the -> and . operators), but I really was able to grasp a lot of OOP concepts that had eluded me previously.

After you've read, say, about the first half of that book, start in with Aaron Hillegass' Cocoa Programming for Mac OS X (2nd edition, with the yellow cover, not the brown one). That ought to get you pretty far in Cocoa programming.

Jan 17, 2007 5:50 AM in response to John Blasquez

Okay, I have come up with a kind of solution for my problem. As I mentioned C# is pretty similar to Java. Well, I decided maybe I should just use Java since it is translated into Obj-C before compilation anyway.

Anyway, doing the Java tutorial (which is the same as the Obj-C tutorial, only in Java) instantly correlated everything for me. I still prefer Java, but the Code Sense for Java is appalling, and I live for Code Sense. Seriously, I basically taught myself C# with code hinting. Anyway I think I've fixed my problem with understanding Obj-C, although I'd still appreciate a location for that PDF you mentioned.

Jan 17, 2007 9:16 AM in response to Morgan Harris

Okay, I have come up with a kind of solution for my
problem. As I mentioned C# is pretty similar to Java.
Well, I decided maybe I should just use Java since it
is translated into Obj-C before compilation anyway.


No. Java is completely separate from Obj-C. Java programs are not converted into Obj-C as any part of the compilation or run-time system.

Anyway, doing the Java tutorial (which is the same as
the Obj-C tutorial, only in Java) instantly
correlated everything for me. I still prefer Java,
but the Code Sense for Java is appalling, and I live
for Code Sense. Seriously, I basically taught myself
C# with code hinting. Anyway I think I've fixed my
problem with understanding Obj-C, although I'd still
appreciate a location for that PDF you mentioned.


If you're interested, there are some Xcode/Java beginners work sheets located here:

http://www.cems.uwe.ac.uk/~lrlang/javasoundmusic/index.html#worksheets

Yes. Code sense for Java is a bit crude - no doubt it will improve as Xcode is developed

Bob

Jan 18, 2007 8:33 PM in response to Morgan Harris

I'm sorry, Morgan, I just discovered that it is no longer distributed as a local file. The file at Apple's web site is:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ObjC.pdf

I really think you ought to read this and pursue Objective-C if you want to be a Cocoa programmer. The roots of Cocoa (NextSTEP, that's where all of the "NS" prefixes come from), especially before OS X, are in ObjC. I believe Java was added with OS X and it hasn't really taken off. You may live and die by code completion, but for me, it's sample code. In either case, you are far better off in ObjC than in Java.

Just my 2¢.

Jan 19, 2007 7:31 AM in response to David Trevas

I was so put off by Objective-C at first. The total lack of dot notation, little whitespace, and all camel case all the time made me feel like I was starting at gibberish. But after going through the Hillegass book, I found coding ObjC was actually a pleasure (and I had zero previous C experience). It was so easy that I barely touched the "Programming in Objective-C" book I got as well.

The syntax is dead simple, and there are very few surprises or inconsistensies. It's also easy to read because Apple's guidelines and naming conventions force you to provide very explicit names for everything as well as label your method arguements.

And the language is going to get a major boost with the release of Leopard. Automatic garbage collection, easy accessors, etc.

If you have previous programming experience, you should have a good time with the Hillegass book.

Jan 23, 2007 12:17 PM in response to Morgan Harris

As easy as it is to learn Java and use the Java-Cocoa bridge, it's better in the long run to learn Obj-C. The Java-Cocoa bridge is being deprecated and Apple won't be updating it in the future.

As was said in this thread, this is the book to get.

http://www.amazon.com/Cocoa-Programming-Mac-OS-2nd/dp/0321213149/sr=8-2/qid=1169 583385/ref=pdbbs2/105-0580945-9887603?ie=UTF8&s=books

Mac Pro 2x2.66, 2GB ram, X1900XT, Mac Mini Duo 1.66, 1GB ram Mac OS X (10.4.8) Mac Mini Solo 1.5, 512MB ram, G5 Single 1.8, 1.5GB ram, PB Titanium 500mhz, 512M

Cocoa/Xcode tutorial for C# developer

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.