]>
Commit | Line | Data |
---|---|---|
d8f41ccd A |
1 | // |
2 | // NewPasswordViewController.m | |
3 | // Security | |
4 | // | |
5 | // Created by john on 10/24/12. | |
6 | // | |
7 | // | |
8 | ||
9 | #import "NewPasswordViewController.h" | |
10 | #import "MyKeychain.h" | |
11 | //#import <SOSCircle/Regressions/SOSRegressionUtilities.h> | |
12 | #import <CKBridge/SOSCloudKeychainClient.h> | |
13 | #import <CKBridge/SOSCloudKeychainConstants.h> | |
14 | #include "utilities.h" | |
15 | ||
16 | static const CFStringRef kAddItemKeyX = CFSTR("AddItem"); | |
17 | ||
18 | ||
19 | @interface NewPasswordViewController () | |
20 | ||
21 | @end | |
22 | ||
23 | @implementation NewPasswordViewController | |
24 | ||
25 | - (void)viewDidLoad | |
26 | { | |
27 | NSLog(@"NewPasswordViewController:viewDidLoad"); | |
28 | [super viewDidLoad]; | |
29 | ||
30 | dgroup = dispatch_group_create(); | |
31 | xpc_queue = dispatch_queue_create("NewPasswordViewController", DISPATCH_QUEUE_CONCURRENT); | |
32 | // Uncomment the following line to preserve selection between presentations. | |
33 | // self.clearsSelectionOnViewWillAppear = NO; | |
34 | ||
35 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. | |
36 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; | |
37 | } | |
38 | ||
39 | - (void)didReceiveMemoryWarning | |
40 | { | |
41 | [super didReceiveMemoryWarning]; | |
42 | // Dispose of any resources that can be recreated. | |
43 | } | |
44 | ||
45 | - (void)postToCloud:(NSDictionary *)kcitem | |
46 | { | |
47 | CFErrorRef error = NULL; | |
48 | testPutObjectInCloud(kAddItemKeyX, (__bridge CFTypeRef)(kcitem), &error, dgroup, xpc_queue); | |
49 | NSLog(@"Sent new item to cloud: %@", kcitem); | |
50 | } | |
51 | ||
52 | - (IBAction)handleNewPasswordDone:(id)sender | |
53 | { | |
54 | // [self performSegueWithIdentifier: @"SegueToScene1" sender: self]; | |
55 | NSLog(@"NewPasswordViewController:handleAddButton"); | |
56 | ||
57 | [[MyKeychain sharedInstance] setPasswordFull:[_itemAccount text] service:[_itemName text] password:[_itemPassword text]]; | |
58 | ||
59 | [self performSegueWithIdentifier:@"AllItemsSegue" sender:self]; | |
60 | } | |
61 | ||
62 | @end |