Friday, October 10, 2008

A brief introduction to developement on iPhone


I joined Pramati a month back and on the very first day I was told to inspect

iPhone developement. Sine then I have been working day and night learning

and applying everything I come across. Just few days to go when I will give

a complete demonstration of my first application on iPhone. Its a mobile

version of Sugar CRM (for those who are unaware of what a CRM is, you can

find more about it at http://www.sugarcrm.com. And btw CRM stands for

Customer Relationship Mangement). So in this article I am going to share

all my experience, difficulties, things that I liked/ not liked with the
developement on iPhone.



First thing that you should know before you start writing applications on iPhone
is Objective-C. As such its' not a difficult language to learn but there are some
specific features that make it more powerfull and some are just enough to make

life as difficult as you can ever imagine.You can find Objective-C tutorials on
http://www.developer.apple.com/iphone.As far as my experience says,
understanding these tutorials is really a heck of a job if you are not familiar with
Object-Oriented Programming. They donot teach you obj-c as other books do
it step by step starting from the very core of basics.So it might be frustating when
you are reading it for the first time (and if you have never developed anything on Mac),

but once you have given it a quick look, try some hand on example codes given on
the developer site and then read it again. It helped me and only after that I realised
the real power obj-c gives you.



In my examples that I will be posting sooner, you will find how even the minor controls
when taken from the compiler to the run-time can make you code so much powerfull.
But as obvius with great power comes great responsibilities. The compiler in such
cases is lame at reporting some of the absolutely basic mistakes we make at times.
An exapmple of such a situation is when you forget to mention data-type of a
parameter expected by a method. obj-c compiler will not even give you a clue of
what wrong is happening.But good news is if you write your code carefully and in a
structured way, it's a beutifull language to work with.



For all my brothers who are also new to this environment, here are some tips for
getting started with iPhone developement
  • Learn the basics of Object Oriented programming(java if you know is very
good, try having a look at "Run-Time Polymorphism")
  • Give a quick look at obj-c (tutorials can be found here)
  • Try playing around with the example code given on developer site of Apple,
write them from scratch, manipulate them, change a few lines and see what happens.
  • Try reading the concepts from the tutorial once again. It gave me a clearer insight of what exactly they mean to do.


And btw, You need Leopard and XCode to play around with iPhone developement, so get them sooner and have a happy coding and coffee nights :P

if you are facing any problems on iPhone developement, feel free to leave a comment and I 'll be more then happy to fugure it out for you :)



6 comments:

  1. tutorials given are nice...could u pls write a tutorial on setting the application preference so that we can access our app settings in the iphone settings.....


    i already got one tutorial from

    http://www.iphonesdkarticles.com/search/label/Application%20Preferences

    but when we make the binary of the application the application settings are not coming in the settings....

    ReplyDelete
  2. Hi Anil, sure I will write 1 this week only, butcan you be a little more specific of the problem you faced? I can then concentrate the post along the same point.

    Although I have never faced a problem like that I wud like to know wat u have done.

    Regards

    ReplyDelete
  3. i followed the tutorial

    http://www.iphonesdkarticles.com/2008/08/application-preferences-part-2.html

    and created the bundle and the plist files as told in the tutorial. When i am building the application ( using Xcode ) my application preference is coming in the settings of iphone and it works fine.

    but when i created the binary of my application for other simulator or other iphone and when i ran the application, the application preference is not coming in the settings.

    hope u got the problem clearly.

    ReplyDelete
  4. Thas strange, Ok ll write 1 covering each and every step so that thers no scope for a mistake.

    The tutorial u referred seems fine to me (although I din go thru the whole tutorial).

    BTW for device I hope you are signing it with a certificate ryt? (cuz some people are able 2 skip that in jaiBroken devices)

    and except iPhoney which one is other simulator? I am unaware.

    Thanks

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. I wanted to know how you use XCODE to create CGI animations. I've been doing much surfing but not getting satisfactory results.

    ReplyDelete

Leave your suggestions