Skip to content

Instantly share code, notes, and snippets.

View nsforge's full-sized avatar
🌿

Nick Forge nsforge

🌿
View GitHub Profile
@nsforge
nsforge / gist:bba2fb28f9d745ff2c33
Created July 9, 2015 01:56
Related Object Lookup Pattern
@interface Person
// Derived from JSON
@property (readonly) NSString *personID;
@property (readonly) NSString *name;
@end
////////////////////////////////////////
@nsforge
nsforge / gist:73fa1d9c77808440a7a7
Last active December 17, 2015 05:13
Lack of warnings on [[self alloc] init] type errors
@interface MyClass : NSObject
@end
@implementation MyClass
+ (void)myMethod
{
NSArray *x = [[self alloc] init]; // This _doesn't_ throw a warning, despite +alloc and -init both being declared as instancetype