Skip to content

Instantly share code, notes, and snippets.

@paolonl
paolonl / gist:6201381
Last active December 20, 2015 21:58 — forked from ksm/gist:3689574
How to get a constant literal container to work.
/*
Source: WWDC2012 Modern Objective-C talk
How to get a constant literal container to work.
*/
@implementation MyClass
static NSArray *thePlanets;
+ (void)initialize {
/*
Enum with Fixed Underlying Type
New with Xcode 4.4
Via WWDC2012 Session 405 - Modern Objective-C
Results in better code completion and stronger type checking.
Use -Wconversion compiler flag to check for enum type errors.
-Wswitch for checking if switch statement is fully handled for enum.
*/