Skip to content

Instantly share code, notes, and snippets.

@PaulTaykalo
Created November 22, 2012 21:33
Show Gist options
  • Save PaulTaykalo/4133008 to your computer and use it in GitHub Desktop.
Save PaulTaykalo/4133008 to your computer and use it in GitHub Desktop.
JSON -> Objective-C Properties (Simple)
#1 Dates first
Replace :
(\w+):\s*"\d+-\d+.*
with
@property(nonatomic, strong) NSDate * $1;
#2 Strings after that
Replace :
(\w+):\s*".*
with
@property(nonatomic, strong) NSString * $1;
#3 Floats next
Replace :
(\w+):\s*\d+\..*
with
@property(nonatomic, assign) CGFloat $1;
#4 Ints last
Replace :
(\w+):\s*\d+.*
with
@property(nonatomic, assign) int $1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment