title: Objective-C Coding Standards?
body: <p>I've been teaching myself Objective-C for about 6 months and like using the language a lot. However I haven't found any good coding standards, so the code I write always ends up looking like an inconsistent mess.</p>
  
  <p>Things like naming conventions carry over just fine, but spacing, indentation and the (impossible?) 80 character line-width aren't working out so well.</p>
  
  <p>What conventions do you use with Objective-C?</p>
  
  <p>Here is a small example of something that isn't working:</p>
  
  <pre><code>- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
      if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
  
          self.navigationItem.leftBarButtonItem = 
          [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
                                                         target:self.parentViewController 
                                                         action:@selector(done:)] autorelease];
  
          NSString* units = [[NSString alloc] initWithFormat:@"%@", @"oz"];
          NSString* optionOne = [[NSString alloc] initWithFormat:@"[%d%@] Calculate", 100, units];
  
          self.options = [[NSMutableArray alloc] initWithObjects: 
                          optionOne, 
                          @"Configure Portions", 
                          @"Configure Notifications",
                          @"Help",
                          nil];
  
          [units release];
          [optionOne release];
          [tableView reloadData];
      }
      return self;
  }
  </code></pre>