Iphone SDK Development Tutorial #2 – Transitioning To Objective-C

This is the second tutorial on iPhone application development.

This tutorial is geared towards someone with a basic understanding of C/C++ or Java and object oriented principles.  It is a basic overview of some Objective-C syntax that someone transitioning from another language is unlikely to be familiar with.

If you’re unfamiliar with C/C++ or Java a great resource is the extensive http://www.learncpp.com/.

>>> The Cheatsheet can be found here <<<

Please note that this cheatsheet will be updated quickly as we continue through the iphone tutorials, and this first iteration is designed only to cover some basic syntax.

Optional Exercise:
Go through the Hello World sample source code  for the iPhone using the understanding gained from the video, referencing the cheat sheet if  necessary along with the Xcode research assistant (see first tutorial if you are unfamiliar with it). In  the next tutorial we will be going through this code line by line.

DeliciousTwitterTechnoratiFacebookLinkedInEmail
Tags: , , , , , , , , ,

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can send a Tweet to @maniacdev on Twitter or submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

  • Cmoss

    Great tutorial dude, one thing I’m wondering about though I see this @class stuff at the top of a file in the HelloWorld code, what is that?

    Keep it up dude.

  • Cmoss

    Great tutorial dude, one thing I’m wondering about though I see this @class stuff at the top of a file in the HelloWorld code, what is that?

    Keep it up dude.

  • John

    Hi Cmoss…

    The @class stuff that you see is a forward class declaration, this allows you to use the class name in variable declarations within another class. Basically it lets the compiler know that it is ok to let you use that class name.

    I get into @class in the next tutorial, it’s just like a forward class declaration in C++.

  • John

    Hi Cmoss…

    The @class stuff that you see is a forward class declaration, this allows you to use the class name in variable declarations within another class. Basically it lets the compiler know that it is ok to let you use that class name.

    I get into @class in the next tutorial, it’s just like a forward class declaration in C++.

  • Cmoss

    Thanks dude

    I’m a JAVA guy so I didn’t know that

  • Cmoss

    Thanks dude

    I’m a JAVA guy so I didn’t know that

  • John

    No problem…

    Check out the site tommorow for the next tutorial, I go into alot of new things when dissecting some source code.

  • John

    No problem…

    Check out the site tommorow for the next tutorial, I go into alot of new things when dissecting some source code.

  • Cmoss

    where is it dude?

  • Cmoss

    where is it dude?

  • John

    Hey Cmoss,

    A couple coding hiccups came up in some software I’m working on that took my time for the whole day, but it will definitely be out by tommorow afternoon I’m working on the slides now.

  • John

    Hey Cmoss,

    A couple coding hiccups came up in some software I’m working on that took my time for the whole day, but it will definitely be out by tommorow afternoon I’m working on the slides now.

  • JohnnysR

    Keep up the good work! I’m waiting for the next tutorial :)
    I’m familiar with c, c++ & Java but objective-c gave me a hard time the first time I saw it. With your video and cheatsheet everything seems much easier.

    Thanks

  • JohnnysR

    Keep up the good work! I’m waiting for the next tutorial :)
    I’m familiar with c, c++ & Java but objective-c gave me a hard time the first time I saw it. With your video and cheatsheet everything seems much easier.

    Thanks

  • John

    Yeah, cheatsheets can definitely make things alot easier, if you’re familiar with C/C++/Java you really shouldn’t have any problems. While Objective-C definitely looks weird, it’s got more in common with C/C++/and Java than it has differences.

  • Shashank

    The CheatSheet URL returns a PAGE NOT FOUND, can you please provide the correct URL ?

  • John

    Thankyou for pointing that out Shashank, I have fixed the link. The error was created when I changed the blog theme.

  • Pingback: The Ultimate iPhone Objective-C Cheat Sheet | maniacdev.com

  • http://maniacdev.com/2009/03/iphone-sdk-development-tutorial-2-transitioning-to-objective-c/ Patty

    The proceeding “+” and “-” just means “static” and “non-static”?

    What does that mean?

  • http://maniacdev.com/2009/03/iphone-sdk-development-tutorial-2-transitioning-to-objective-c/ Patty

    The proceeding “+” and “-” just means “static” and “non-static”?

    What does that mean?

  • John

    Hi Patty,
    When you create a static (or class) method it is not created when you make an object. It belongs to the class, and the same memory location in memory containing that class is used by all objects, and you can use it directly from the class without even creating an object.. like you can run it as [ClassName staticMethod] rather than [objectName staticMethod].

    Non-static means that with every object you create that method a different method is created in memory, and you run them usinh [objectName staticMethod].

    In Objective-C from what I understand technically the methods are always placed in static, but I mentioned it being similar to the word static, as that is the terminology used in C/C++/Java and the behavior of the +/- modifiers you see at the start of a method cause the behaviour to be similar.

    Hope I didn’t confuse you more!

  • John

    Hi Patty,
    When you create a static (or class) method it is not created when you make an object. It belongs to the class, and the same memory location in memory containing that class is used by all objects, and you can use it directly from the class without even creating an object.. like you can run it as [ClassName staticMethod] rather than [objectName staticMethod].

    Non-static means that with every object you create that method a different method is created in memory, and you run them usinh [objectName staticMethod].

    In Objective-C from what I understand technically the methods are always placed in static, but I mentioned it being similar to the word static, as that is the terminology used in C/C++/Java and the behavior of the +/- modifiers you see at the start of a method cause the behaviour to be similar.

    Hope I didn’t confuse you more!

  • John

    Yeah, cheatsheets can definitely make things alot easier, if you're familiar with C/C++/Java you really shouldn't have any problems. While Objective-C definitely looks weird, it's got more in common with C/C++/and Java than it has differences.