File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "Help with meaning of dot in .size" Watch "Help with meaning of dot in .size" New topic

Help with meaning of dot in .size

Larry Frissell
Ranch Hand

Joined: May 16, 2008
Posts: 82
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
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
Similar Threads
sink a dot com game in k&b
custom validator error message
Object.otherObject = yetAnotherObject
how remove dot from error message
How do the values change even if I am not passing the arrays with reference?