Hmmmm I got the tutorial working in the iPad Application Development book, chapter 11. But when I got to the section on gestures there was some syntax I'm unsure about. I need to go back to Goldstein's Objective-C book. I worked on that last year, but clearly I need to do some refreshing.
There's developing abilities with the framework but then every once and a while the language trips me up. I can't afford that when I want to focus on the framework documentation. So back-to-grass-tacks for awhile. What are grass tacks anyway? Am I even remembering the idiom correctly?
Going to summarize syntax as I go, starting with chapter 6 of the objective-c book.
- Method declarations are like function prototypes in Objective-C (page 146-7)
- When there's only one argument, I'll see just one ':' but there are lots of methods that take more than one argument. The number of ":"'s (colons) shows how many argments there are
- The code below declares the "createBudget:: method. It has two argments
- -(void) createBudget:(double) aBudget
- withExchangeRate: (float) anExchangeRage;
- The COLON is considered to be a PART OF THE METHOD NAME
- If there are no colons than there are no arguments
- The real method name is createBudget:withExchangeRate
- Notice that "("'s are used around both the
- return value
- argument/data types - because we are casting one type to another (chapter 4)
- Inside of the method I am declaring, I will access the arguments using the identifier names 'aBudget' and 'anExchangeRate'
No comments:
Post a Comment