I just downloaded the iPhone SDK like three days ago and I have too much problems starting. I am looking for easy documentation about Objective-C, Cocoa and the important things. I have a lot of programming experience with PHP and a little with C++ and Visual Basic .NET. I just don't have any experience with Objective Oriented programming.
The documentation from Apples site is too booring and I think that you must be an experienced programmer to actualy understand that. So where can I find something easy to learn? I don't like video tutorials because you can't follow it as easy as written thing.
Intro to Obj-C and Cocoa Fundamentals are on the Apple site.
Programming in Objective-C by Stephen Kochan
and
Cocoa Programming for Mac OS x by Hillegass.
Learn Obj-C first. Cocoa is the Mac framework (all the extras beyond the language) Note that
the phone is a subset of Cocoa for the Mac and in some areas there are totally different methods. So the Cocoa programming book is only 50-70% relatable to the iPhone.
If this is for the iPhone download the iPhone Programming Guide along with the ViewController Guide and the TableView guide. Actually read them.
Download ALL of the examples.
Consider printing out the online PDF files at Kinkos or somewhere $20-25 for a book with basic binding.
Great!
I looked at Cocoadevcentral tutorial and it was probably as confusing as The Objective C 2.0 Programming Language on the apples site. Somebody already told me to look at the documents on the Apples site in this order:
1) The Objective-C 2.0 Programming Language
2) Cocoa Fundamentals Guide
3) iPhone OS Programming Guide
4) View Controller Programming Guide for iPhone OS
5) Table View Programming Guide for iPhone OS
6) Quartz 2D Programming Guide
7) Core Animation Programming Guide
I think that that foloving guides are better than the first one - and that is the most problematic one. Its hard to learn objective oriented programming from that guide.
And I need this tutorials for iPhone - Maybe later for OSX but for now - just the iPhone.
I have read that three times on three different sites without knowing that I read it before. That probably mens that I didn't understand it like I should.
Thanks for this. I just have some problems understanding Classes. That is the only thing I read about but I don't understand them.
SO classes are normaly in different files - cass.h and class.m. Why are some variables defined in the class.h file? Do they all have to be defined there? Because you can define new variable in the class.m file. If I create new view and go to write class files I get the textboxes and labels... defined in class.h file - and if they are not defined there they don't work. The question here is Why can't I just use one source file for the whole program - I know that this is possible with PHP? Why do I have to use different class files - and when must this files be created?
This are my questions - probably they don't make any sense but If someone does know what I am thinking about - please help.
EDIT: Is it possible to use non-objective language with iphone SDK?
These are basics roli that apply to almost any language. Class is a structure that defines particular object. In Objective-C syntax class is defined by 2 separate files:
a) Header file .h
b) implementation file .m
In .h file you define an interface for this class. You make a description of class (define it's properties, it's methods, etc...). In .m file you just implement these methods. The variables that you define in .h files are called instance variables and can be accessed from outside world. The variables you define in .m file are temporary local variables.
This Wikipedia article might give you some better understanding of the OOP terms.
Make sure you get them right otherwise it will be really hard for you to start with Cocoa programming. Make first some basic OOP examples in any language and then try with iPhone programming.
Problem is that there are no easy OOP guides for any language. OOP is just complicated and I have to live with it.
I disagree. There are many books and guides online that guide you into OOP. These can be language independent, it doesn't matter whit which language you start with OOP. Choose one you're most familiar (might be PHP as well as it supports full OOP) and go trough some tutorials. There's plenty online.
I second that, once you understand it OOP makes a LOT of sense, before jumping in with iPhone development learn some OOP basics, like Jume said, PHP has full OOP support.
I personally found Ruby to be a really good language to really get to grips with OOP, as the language itself gets out of the way.
YMMV of course.
Last edited by craig t mackenzie; 08-20-2008 at 10:30 AM.
Reason: craig can't spell
I didn't think about PHP OOP. I know that it suports OOP I just never thought about learning OOP for PHP and then using it with iPhone.
I found a PHP OOP tutorial that starts like this:
Object-Oriented Programming (OOP) tutorials are generally bogged down with programming theory and large metaphysical words such as encapsulation, inheritance and abstraction. They attempt to explain things by comparing code samples to microwaves or automobiles, which only serves to confuse the reader more.
I agree with the last line! Thanks for the help! I will read these tutorials and will see how it goes.
I have read three tutorials about PHP OOP. These things are realy short (about 6 normal pages). Actualy they helped a lot about understanding the OOP. It is not great but I know now what are classes, methods and propertyes and how they are used - at least I know what the thing on Apples site is about. But I think that Objective C is a little larger that that.
Problem with OOP is that it is something different. I remember mw learning my first programming language (Visual Basic) when I was 13. I learnd something but it took a while to learn that - it was just something new. The same is with OOP.