wood burning stoves 2.0*
The moose likes iOS and the fly likes Help with meaning of dot in .size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "Help with meaning of dot in .size" Watch "Help with meaning of dot in .size" New topic
Author

Help with meaning of dot in .size

Larry Frissell
Ranch Hand

Joined: May 16, 2008
Posts: 82
    
    2
I am reading IOS 5 Developer's Cookbook by Erica Sadun. In the line of code below, I am trying to understand why there is a dot before "size". I know that "size" is a property of CGRect, and I understand how to use the "dot" for something like frame.width, but the syntax below appears to be different.

Larry Frissell
Ranch Hand

Joined: May 16, 2008
Posts: 82
    
    2
I have found my answer to the code snytax at cupsofcocoa
It is based on the C structs format shown below.
Initializing Structures
The fastest way to initialize a structure is to enclose the values in a pair of braces:

Date today = {5, 22, 2011};You can list fewer values, and they will be filled in until the end of the values you list. The remaining values will be undefined.
Date today = {5};This sets the month to 5, but leaves the remaining fields with garbage values from RAM.
You can also initialize the values out of order:
Date today = {.day = 22, .month = 5; .year = 2011};


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help with meaning of dot in .size