Categories
Featured iPhone Development Resources

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.

23 replies on “Iphone SDK Development Tutorial #2 – Transitioning To Objective-C”

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.

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.

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++.

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++.

No problem…

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

No problem…

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

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.

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.

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

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

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.

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

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!

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!

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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.