• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with meaning of dot in .size

 
Ranch Hand
Posts: 82
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 82
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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};



 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic