Moving from C to Objective-C?
I was wondering what I needed to know in terms of C to move o开发者_运维问答nto Objective-C. I would be uber-grateful if you could let me know what you think is sufficient to move on Objective-C.
Thanks, ~Daniel
If you're looking to learn C before moving on to Objective-C (which, in my opinion, is a great idea), I would recommend to you Steve Kochan's 'Programming in Objective-C 2.0'. Very similar to his 'Programming in C' book, it will contain all the C you're going to need to use Objective-C, and it's a great primer for learning both languages.
If you're not looking to read a book, though, or you already have one, I would assume that after learning pointers, you will have covered most of the important parts of the C language (of course, it will depend on the order of material in the book, but pointers are usually sufficiently advanced to move on). Good luck!
You need a book. "Programming in Objective-C 2.0" is a fairly good one, and there are a few others. It's not a bad idea to have two or three.
You need to understand basic pointer concepts. C or C++ is the way to go for that.
You need to understand basic object-oriented concepts. Objective-C is a poor platform on which to learn them, so you may want to first learn basic OO concepts on C++ or Java first.
Once you get started with Objective-C, you need to learn the screwy syntax, of course, and all about the UI concepts, but, more importantly, you need to really, REALLY understand and "internalize" the Objective-C heap management scheme. Java gives you no hint of this, C++ is a poor background, Qt is a hair better, but still pretty far off the mark, so pretty much you have to pick it up as you learn Objective-C.
Yes, we have a lot of kids here that have learned how to take an Objective-C example, modify a few lines, and produce an "app", without actually understanding what they are doing. But learning that way they're never going to be able to produce anything of consequence. You need to INVEST in learning, not simply "pick it up as you go".
Personally I would suggest you learn C++ so that you can master the concept of polymorphism, which is pretty important in objective C and iPhone programming. Since you already know C I think that this would be better than jumping from C to objective C.
精彩评论