Skip to content

Instantly share code, notes, and snippets.

@keicoder
Created February 22, 2014 08:04
Show Gist options
  • Select an option

  • Save keicoder/9150283 to your computer and use it in GitHub Desktop.

Select an option

Save keicoder/9150283 to your computer and use it in GitHub Desktop.
objective-c : using basic NSDictionary
//using basic NSDictionary
//inside DataModel.m
- (void)registerDefaults {
NSDictionary *dictionary = @{
@"ChecklistIndex" : @-1,
@"FirstTime" : @YES //“FirstTime” acts as a boolean value because it’s either yes or no (true or false)
};
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
}
//call method
- (id)init {
if ((self = [super init])) {
[self registerDefaults];
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment