Results 1 to 4 of 4
  1. #1
    Learning objective-c please help!

    Member Since
    May 30, 2010
    Posts
    2
    Question Learning objective-c please help!
    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.

  2. #2
    Learning objective-c please help!

    Member Since
    May 27, 2010
    Posts
    21
    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.

  3. #3
    Learning objective-c please help!

    Member Since
    May 30, 2010
    Posts
    2
    thanks, that is helping to make a little sense of things.

  4. #4
    Learning objective-c please help!

    Member Since
    May 27, 2010
    Posts
    21
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Objective-C help
    By bikka in forum OS X - Development and Darwin
    Replies: 22
    Last Post: 05-27-2014, 02:56 PM
  2. Need help in objective C
    By prateek.chaubey in forum iOS Development
    Replies: 3
    Last Post: 09-23-2011, 09:12 PM
  3. Objective-C
    By eddielee in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 02-02-2011, 12:27 PM
  4. Is Objective For me?
    By Estanislao in forum OS X - Apps and Games
    Replies: 1
    Last Post: 05-26-2009, 04:13 AM
  5. Objective-C
    By AstralZenith in forum OS X - Development and Darwin
    Replies: 13
    Last Post: 03-09-2003, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •