General

Cicero27 Jun

The budget should be balanced, the Treasury should be refilled, public debt should be reduced, the arrogance of officialdom should be tempered and controlled, and the assistance to foreign lands should be curtailed lest Rome become bankrupt. People must again learn to work, instead of living on public assistance.
- Cicero (55 B.C.)

General

UINavigationController inside a UITabBarController23 Jun

I was having a head-banging session last night trying to get a UINavigationController working within a UITabBarController. I reached out to peers from Big Nerd Ranch, and received a very succinct solution from Brian Slick:

I just yesterday rewired my program to use a XIB file in this way. The resulting structure looks like this:

Tab Bar Controller

…..Tab Bar

…..Navigation Controller

……….Navigation Bar

……….MyViewController1

……….Tab Bar Item

…..Navigation Controller

……….Navigation Bar

……….MyViewController2

……….Tab Bar Item

Just drag however many UINavigationControllers you need from the palette to the Tab Bar Controller. Crack open each one, and set the class of the View Controller inside to be your appropriate custom class.

Just follow along the XIB paths, and it works flawlessly. Awesome. (Also, don’t forget to set the various tabs to NavigationController at the root of the UITabBarController.)

General

Help create a world with more birthdays.11 Jun

General

Objective-C method naming10 Jun

from Cocoa with Love

Structure of an Objective-C method name

Objective-C methods are composed of a few different components. I’ll list the components here, examples follow:

  1. If there is a return value, the method should begin with the property name of the return value (for accessor methods), or the class of the return value (for factory methods).
  2. A verb describing either an action that changes the state of the receiver or a secondary action the receiver may take. Methods that don’t result in a change of state to the receiver often omit this part.
  3. A noun if the first verb acts on a direct object (for example a property of the receiver) and that property is not explicit in the name of the first parameter.
  4. If the primary parameter is an indirect object to the main verb of the method, then a preposition (i.e. “by”, “with”, “from”) is used. This preposition partly serves to indicate the manner in which the parameter is used but mostly serves to make the sentence more legible.
  5. If a preposition was used and the first verb doesn’t apply to the primary parameter or isn’t present then another verb describing direct action involving the primary parameter may be used.
  6. A noun description (often a class or class-like noun) of the primary parameter, if this is not explicit in one of the verbs.
  7. Subsequent parameter names are noun descriptions of those parameters. Prepositions, conjunctions or secondary verbs may precede the name of a subsequent parameter but only where the subsequent parameter is of critical importance to the method. These extra terms are a way to highlight importance of secondary parameters. In some rarer cases secondary parameter names may be a preposition without a noun to indicate a source or destination.

In addition, an Objective-C method should be maximally readable — its reading should flow like a sentence and abbreviations should be avoided except where they are universally known (and even then, abbreviations to syllables rather than single letters are preferred).

About Me

I am an expert in digital video, a founder of multiple companies, inventor of the verified viewing process, and have numerous patents pending concerning methods of digital video distribution. Since 1996 I have provided software and service solutions to entertainment production companies throughout Los Angeles and New York. My companies, software, and services have helped produce the television shows ‘ABC’s Extreme Makeover: Home Edition,’ ‘MTV’s Yo Momma,’ ‘FOX’s Nanny 911,’ and ‘Comedy Central’s The Showbiz Show with David Spade,’ among many others.

I hold a Bachelor of Science from Arizona State University, am an active member of the Producer’s Guild of America, and public speaker. I am also a published author: Digital Video Hacks (O’Reilly; ISBN 0596009461) and Videoblogging (Wiley; ISBN 0470037881) have helped thousands of people understand how to produce and distribute digital video with a high level of competence. When not consumed with work, I live, love, and enjoy life with my family.

Contact Form

If the you have stripped your referrer fields in you browser, or are using a proxy or are behind a firewall, this form may not work!