When developing Applications for the iPhone there is a very interesting language that you should learn. Even if you have a background in web Development, and you are familiar with JavaScript, Perl or PHP. It still may seem very hard. Even though it may take you a couple tries at learning this new language, if you are going into developing for the iPhone it is the language to know.
The language that we are going to discuss is called Objective-C. This language is referred to as the native language for developing Applications for the iPhone. This language is an object-orient of C. With this language you can really do some amazing and powerful programming with C/C+. You can also create thing with this code that will make life much easier for example you could create an automated memory management. With this code you could also create a pointer arithmetic.
Create An Iphone App
On a side note I am going to explain what a pointer is. Because a lot of people stay away from using pointers because they really don't understand them and they don't know what they are. A good way to think about it is, it is something that knows where an object is in memory. Once you understand what it is and what it does you may be more inclined to use them.
In a object-oriented language one of the first things that you will want to know is that you need to instantiate which mean that you would declare that something is there so that you could refer back to it. For example if you were going to use mammal1 in your source code then it would have to have to attributes. Those would be furcolor and milkfatratio. If you were using JavaScript then it would look something like this: var aMammal1 = new Mammal ("orange", 0.15).
Because that is what you are used to seeing then when you go to use this type of code it make look very odd and take you a while to get in the habit of typing your code differently. If you were going to use The Objective-C your code may look something like this: Mammal *aMammal1 = [[Mammal alloc] intiWithColor: @"orange" and MilkFatRatio: 0.15];. It has more that you would need to type out but this is a very strong language to program in.
Some of that code may have not made much sense and some of it may have made some sense to you. But if you break it down and take a look at it the alloc does make sense. The reason that it makes sense is because it is how the Mammal1 object is allocated space in RAM. The words intiWithColor and and MilkFatRatio make great setters or passers of the two intended parameters.
So basically all this means is the Objective-C uses message passing for all the interactions with objects and other items that might not be in the other languages that you may be used to programming in.
When you decide to start looking into developing Applications for the iPhone don't give up and get frustrated. Once you have learned this language then there is endless possibilities with what you can do with you programming.
What is the Language Objective-C?
No comments:
Post a Comment