ObjC

Always capitalize and space comments using //

// Good
- (void)doAction
{
  // Some comments
}

Always newline curly bracket

// Good
if(newLineCurly)
{
}

Always one newline between blocks of code

// Good
- (void)doAction
{
  if(blockNewline)
  {
    // Block
  }

  if(blockNewLine)
  {
    // Block
  }

}

Always namespace classes with a minimum of 2 capitalized chars

// Good
@interface PEMyNamespace

Always camel case

// Good
@interface PEMyCamelCaseClass
- (void)doCamelCase
NSString * myCamelCaseVariable = 0;

Always not underscore methods

// Bad
- (void)_doAction;
@end

Use @protocol for strong api definition

Always imperative method name

- (void)doAction

Always include a preposition for methods with arguments

- (void)doActionWithArgName:(NSObject *)firstArg

Always spaces between additional arguments

- (void)doActionWithArgName:(NSObject *)firstArg andSecondArgName:(NSObject *)secondArg

For generic utility methods uniquely describe params

// Good
- (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target
                                        withString:(NSString *)replacement
// Bad
// Apple documentation examples
- (BOOL)localizedStandardContainsString:(NSString *)str
- (NSRange)rangeOfString:(NSString *)aString
- (NSRange)rangeOfString:(NSString *)string

Note: Apple doesn’t have a parameter convention.

Always upper snake case #define

#define UPPER_SNAKE_CASE_FLAG 0

Always explicitly check for nil

// Good
if(nil == myFoo)
// Bad
if(myFoo)
if(!myFoo)

Can’t find a standard?

When in doubt follow Apple’s conventions