4 ms·
Enable modules and use them to import system frameworks: // #import <Cocoa/Cocoa.h> @import Cocoa; Use literals and subscripting methods: NSNumber *
by program 13y ago
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-c-features 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
};
- AshFurrow 13y agoGood tips, too! I tried to stay away from more stylistic things, but I do agree with you.