Learning objective-c please help!

Joined
May 30, 2010
Messages
2
Reaction score
0
Points
1
Hi,

I'm learning objective-c by reading objective-c for dummies.

Currently I'm learning about "struct" and "typedef" and all of a sudden the author started using a new format for variables without an explanation, believe me I looked.

For example:

"variable.variableName"

And I don't understand why there is a period in between the two variable names, and I'm wanting to take my time and understand every little thing about this new language.

So if someone wouldn't mind taking their time to answer this, I'm sure the answer is fairly simple, thank you.
 
Joined
May 27, 2010
Messages
21
Reaction score
0
Points
1
I don't know Objective-C. But in "variable.variableName" maybe "variable" is a the name of a structured variable that contains a component called "variableName."

In Pascal, you can define a record type, Pascal's struct, if you will, by writing something like this:

Code:
[B]type[/B] Car_Type =
            [B]record[/B]
               Make: String;
               Model: String;
               Year: integer
           [B] end[/B];

Then, if, say, My_Car, is a variable of that type, "My_Car.Make" stands for the My_Car record's "Make" component, "My_Car.Model" stands for the My_Car variable's "Model" component, and "My_Car.Year" stands for that variable's "Year" component.

Hi,

I'm learning objective-c by reading objective-c for dummies.

Currently I'm learning about "struct" and "typedef" and all of a sudden the author started using a new format for variables without an explanation, believe me I looked.

For example:

"variable.variableName"

And I don't understand why there is a period in between the two variable names, and I'm wanting to take my time and understand every little thing about this new language.

So if someone wouldn't mind taking their time to answer this, I'm sure the answer is fairly simple, thank you.
 
Joined
May 27, 2010
Messages
21
Reaction score
0
Points
1
You're welcome, brentbyoung. Now that I've read briefly about Objective-C's structured types, I know that my explanation was correct. In your example, "variable.variableName," does stand for the "variableName" component of the structure named "variable." I should have done my homework before I answered your post.
thanks, that is helping to make a little sense of things.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top