9 Replies Latest reply: Jan 23, 2007 12:17 PM by Thomas Alvarez
Morgan Harris Level 1 Level 1 (10 points)
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
  • David Trevas Level 2 Level 2 (230 points)
    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.
  • Morgan Harris Level 1 Level 1 (10 points)
    Thanks man. And C# is, as far as I can tell, not a thing like C. In fact it has a lot more in common with Java.

    And, oh ****, I just deleted the DMG with said PDF in it. Thank god for unlimited downloads :P
  • Morgan Harris Level 1 Level 1 (10 points)
    Um, further to that: I cannot find any PDF with that name in my /Developer folder. In fact, there are only three PDFs in that folder/subfolders. What are you referring to?
  • John Blasquez Level 1 Level 1 (5 points)
      
    Just want to ask those who read this thread to consider the similar request on this forum at:

        http://discussions.apple.com/thread.jspa?threadID=819234&tstart=0

    Please reply in that thread.

    Thanks!

    John
  • Morgan Harris Level 1 Level 1 (10 points)
    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.
  • Bob Lang1 Level 5 Level 5 (4,080 points)
    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
  • David Trevas Level 2 Level 2 (230 points)
    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¢.
  • diffkid Level 3 Level 3 (790 points)
    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.

       
  • Thomas Alvarez Level 1 Level 1 (20 points)
    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