Objective C #1 – Return Values

Recently I began to teach myself Objective C. My final goal is to program in Cocoa for the Mac. The process is slow going, but really interesting. I’m adding a regular section to highlight some of my thoughts about learning a programming language. The first post is about “Return Values”

-(void) setNumerator;

This expression declares a new method that is not expected to return anything (i.e. void)

-(double) myNumber;

declares a method that should be returning a double precision number

-(int) getNumber;

should return an integer.

All this is very cool. It makes it pretty easy to see what kind of result should come back when the method is put into action. While it’s not as direct as Ruby, I’m getting it. I’m even more green with Ruby, but I’ve heard such great things about it, that I had to check it out. I highly recommend this quirky but entertaining guide.

Technorati Tags: , , ,

Advertisements

One Response to Objective C #1 – Return Values

  1. joey_g says:

    this one post very good. i enjoy very much!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: