-
-
Save matzew/80ef7d756c15ca774907 to your computer and use it in GitHub Desktop.
Delegate with PList Store:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "AGViewController.h" | |
#import "AGAppDelegate.h" | |
#import "AeroGear.h" | |
@implementation AGAppDelegate { | |
AGDataManager* dm; | |
id<AGStore> myStore; | |
} | |
- (BOOL)application:(UIApplication *)application | |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// create the datamanager | |
dm = [AGDataManager manager]; | |
// add a new (default) store object: | |
myStore = [dm store:^(id<AGStoreConfig> config) { | |
[config setName:@"tasks"]; | |
[config setType:@"PLIST"]; | |
}]; | |
NSLog(@"didFinishLaunch: %@", [myStore readAll]); | |
return YES; | |
} | |
- (void)applicationDidBecomeActive:(UIApplication *)application { | |
NSLog(@"applicationDidBecomeActive: %@", [myStore readAll]); | |
[myStore save:@{@"test": @"test", @"id": @"1"} error:nil]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment