New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Learning objective-c please help!


Post Reply New Thread Subscribe

 
Thread Tools
brentbyoung

 
Member Since: May 30, 2010
Posts: 2
brentbyoung is on a distinguished road

brentbyoung is offline
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.
QUOTE Thanks
Bill McEnaney

 
Member Since: May 27, 2010
Posts: 21
Bill McEnaney is on a distinguished road

Bill McEnaney is offline
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:
type Car_Type =
            record
               Make: String;
               Model: String;
               Year: integer
            end;
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.

Quote:
Originally Posted by brentbyoung View Post
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.
QUOTE Thanks
brentbyoung

 
Member Since: May 30, 2010
Posts: 2
brentbyoung is on a distinguished road

brentbyoung is offline
thanks, that is helping to make a little sense of things.
QUOTE Thanks
Bill McEnaney

 
Member Since: May 27, 2010
Posts: 21
Bill McEnaney is on a distinguished road

Bill McEnaney is offline
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.
Quote:
Originally Posted by brentbyoung View Post
thanks, that is helping to make a little sense of things.
QUOTE Thanks

Post Reply New Thread Subscribe


« Automating command; extracting files from folders and copying them into a single fold | PackageMaker: Add to PATH? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
dynamic mwmory allocation in objective c drewangel OS X - Development and Darwin 1 03-17-2010 01:45 AM
Has to be an easier way to deal with Time in Objective C fajhetti OS X - Development and Darwin 2 02-03-2010 11:43 AM
Objective C Books that don't need C knowledge J-Mak OS X - Development and Darwin 4 10-27-2009 12:31 AM
question about objective C memory allocation thuffir OS X - Development and Darwin 3 11-18-2008 10:30 PM
Learning Logic.... whoriental Music, Audio, and Podcasting 2 02-05-2006 08:55 AM

All times are GMT -4. The time now is 10:12 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?