Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Enable modules and use them to import system frameworks:

   // #import <Cocoa/Cocoa.h>
   @import Cocoa;
Use literals and subscripting methods:

   NSNumber *yes = @YES;
   NSNumber *number = @42;
   NSArray *array = @[@"Hello", @"World"];
   NSDictionary *dictionary = @{ @"name" : NSUserName() };
Learn about "instancetype": http://clang.llvm.org/docs/LanguageExtensions.html#objective...

Always use NS_ENUM and NS_OPTIONS to declare enum types:

   typedef NS_ENUM(NSInteger, HNExample) {
      HNExampleDefault,
      HNExample1,
      HNExample2
   };


Good tips, too! I tried to stay away from more stylistic things, but I do agree with you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: