2056 Views 9 Replies Latest reply: Jan 23, 2007 12:17 PM by Thomas Alvarez
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.
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.
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:
Yes. Code sense for Java is a bit crude - no doubt it will improve as Xcode is developed
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:
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¢.
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.
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.
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