4 ms·
Structuring Modern Objective-C
- liviu 13y agoThank you Ash, I was looking for that for long time. I'm happy that I found your blog with so many iOS resources. I'll read them all and I'll follow your activity a there.
- program 13y agoEnable 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.
- anon1385 13y ago>Instead, you should be declaring them as properties, and then accessing them through message-passing or dot syntax. Dot syntax is message passing. This type of confusion is one of the reasons I really hate dot syntax.
- AshFurrow 13y agoI know. I was referring to the message-passing syntax or dot syntax.