Tag Archives: iphone

My first Hello world program in Objective-C

Here is my first program that I wrote in Objective-C, and keeping with the tradition, it has to be the Hello World program.

   1:  /* This is a simple hello world program */
   2:   
   3:  /* Includes the systems file Foundation.h that has some 
         specific classes. */
   4:  #import <Foundation/Foundation.h>
   5:   
   6:  //Begin Execution
   7:  int main (int argc, const char *argv[])
   8:  {
   9:     /* For now, the below code is mainly for memory 
          management. Reserves space in memory. */
  10:     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  11:     /* NSLog is a function that displays the argument you 
          pass along with some other information.*/
  12:     NSLog (@"Hello World");
  13:     //Release the allocated memory pool
  14:     [pool drain];
  15:     //Terminate the execution of main. 
  16:     return 0;
  17:  }
 
 

Since my current background is C#, I am quite happy to find the delimiter ‘;’ is the same in Objective-C;). However what is unsettling to me is the whole memory management. I got really comfortable with .net garbage collection. Commenting style is pretty much the same as others. I mixed up the commenting style to show both styles are possible. Microsoft looks like a saint to me compared to Apple when it comes to forcing me to develop on a MAC. Anyway’s, I will be sharing more code samples, more information in the coming days as I progress through my quest to build the greatest IPhone App.

Getting started with IPhone Development

I will be doing a lot of learning around IPhone and its App development in the coming days. Hopefully my blog posts will help somebody like me who is looking to get started with IPhone development. I will be covering more topics in the coming days as I get myself up-to-date with this technology. To get started, I am creating a list of resources that I can access during my learning phase. Having a finite list that won’t grow over time is important to quickly get up-to-speed on some new platform and then use your experience to write good software. So, in this spirit, as a good first step, I created the following list of resources.

Firstly the book which everyone considers a bible for IPhone development is Programming in Objective-C 2.0, by Stephen G. Kochan. It is currently in its second edition.

Programming in Objective-C 2.0, Second Edition - Graphically Rich Book

Next are some favorite sites, tips that I collected to get myself started on IPhone development.

IPhone Development: 12 Tips To Get You Started

CS193P - Cocoa Programming | Announcements(Stanford Course)

iCodeBlog

Cocoa Is My Girlfriend

AppsAmuck IPhone Development Tutorials and Examples

Cocoa with Love

http://www.iphonesdkarticles.com/

CocoaLab

Hopefully, all these tutorials will help me build my first IPhone App.

So, my next steps are as follows:

  • Setting up a development environment.
  • Become a registered IPhone developer.
  • Create a list of best practices for IPhone app development.
  • Study architectures of existing apps to gain better understanding.