2 // NewPasswordViewController.m
5 // Created by john on 10/24/12.
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"
16 static const CFStringRef kAddItemKeyX = CFSTR("AddItem");
19 @interface NewPasswordViewController ()
23 @implementation NewPasswordViewController
27 NSLog(@"NewPasswordViewController:viewDidLoad");
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;
35 // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
36 // self.navigationItem.rightBarButtonItem = self.editButtonItem;
39 - (void)didReceiveMemoryWarning
41 [super didReceiveMemoryWarning];
42 // Dispose of any resources that can be recreated.
45 - (void)postToCloud:(NSDictionary *)kcitem
47 CFErrorRef error = NULL;
48 testPutObjectInCloud(kAddItemKeyX, (__bridge CFTypeRef)(kcitem), &error, dgroup, xpc_queue);
49 NSLog(@"Sent new item to cloud: %@", kcitem);
52 - (IBAction)handleNewPasswordDone:(id)sender
54 // [self performSegueWithIdentifier: @"SegueToScene1" sender: self];
55 NSLog(@"NewPasswordViewController:handleAddButton");
57 [[MyKeychain sharedInstance] setPasswordFull:[_itemAccount text] service:[_itemName text] password:[_itemPassword text]];
59 [self performSegueWithIdentifier:@"AllItemsSegue" sender:self];