Skip navigation
This discussion is archived

Cocoa/Xcode tutorial for C# developer

1712 Views 9 Replies Latest reply: Jan 23, 2007 12:17 PM by Thomas Alvarez RSS
Morgan Harris Calculating status...
Currently Being Moderated
Jan 15, 2007 1:26 AM
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)
    Currently Being Moderated
    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.
    Power Mac G5 2x2, iBook, eMac, Mac OS X (10.4.7), PM: 1.5 GB, iB: 500MHz, 640MB RAM, 80GB HD
  • John Blasquez Level 1 Level 1 (5 points)
    Currently Being Moderated
    Jan 16, 2007 9:56 PM (in response to Morgan Harris)
      
    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
    PowerBook G4, Mac OS X (10.4.7)
  • Bob Lang1 Level 5 Level 5 (4,080 points)
    Currently Being Moderated
    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
    Mac Book, Mac OS X (10.4.8)
  • David Trevas Level 2 Level 2 (230 points)
    Currently Being Moderated
    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¢.
    Power Mac G5 2x2, iBook, eMac, Mac OS X (10.4.8), PM: 1.5 GB, iB: 500MHz, 640MB RAM, 80GB HD
  • diffkid Level 3 Level 3 (790 points)
    Currently Being Moderated
    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.

       
  • Thomas Alvarez Calculating status...
    Currently Being Moderated
    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

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.