]>
Commit | Line | Data |
---|---|---|
d8f41ccd A |
1 | // |
2 | // KCAItemDetailViewController.m | |
3 | // Security | |
4 | // | |
5 | // Created by John Hurley on 10/24/12. | |
6 | // | |
7 | // | |
8 | ||
9 | #import "KCAItemDetailViewController.h" | |
10 | #import "EditItemViewController.h" | |
11 | ||
12 | @interface KCAItemDetailViewController () | |
13 | ||
14 | @end | |
15 | ||
16 | @implementation KCAItemDetailViewController | |
17 | ||
18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
19 | { | |
20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | |
21 | if (self) { | |
22 | // Custom initialization | |
23 | } | |
24 | return self; | |
25 | } | |
26 | ||
27 | - (void)viewDidLoad | |
28 | { | |
29 | [super viewDidLoad]; | |
30 | // Do any additional setup after loading the view. | |
31 | ||
32 | // NSLog(@"_itemDetailModel: %@", _itemDetailModel); | |
33 | _itemName.text = [_itemDetailModel objectForKey:(__bridge id)(kSecAttrService)]; | |
34 | _itemAccount.text = [_itemDetailModel objectForKey:(__bridge id)(kSecAttrAccount)]; | |
35 | ||
36 | NSData *pwdData = [_itemDetailModel objectForKey:(__bridge id)(kSecValueData)]; | |
37 | if (pwdData) | |
38 | { | |
39 | NSString *pwd = [[NSString alloc] initWithData:pwdData encoding:NSUTF8StringEncoding]; | |
40 | _itemPassword.text = pwd; | |
41 | } | |
42 | else | |
43 | _itemPassword.text = @""; | |
44 | ||
45 | _itemCreated.text = [[_itemDetailModel objectForKey:(__bridge id)(kSecAttrCreationDate)] description]; | |
46 | _itemModified.text = [[_itemDetailModel objectForKey:(__bridge id)(kSecAttrModificationDate)] description]; | |
47 | } | |
48 | ||
49 | - (void)didReceiveMemoryWarning | |
50 | { | |
51 | [super didReceiveMemoryWarning]; | |
52 | // Dispose of any resources that can be recreated. | |
53 | } | |
54 | ||
55 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
56 | { | |
57 | if ([[segue identifier] isEqualToString:@"ItemEdit"]) | |
58 | { | |
59 | NSLog(@"Preparing seque to EditItemViewController: %@", _itemDetailModel); | |
60 | EditItemViewController *editItemViewController = [segue destinationViewController]; | |
61 | editItemViewController.itemDetailModel = [NSDictionary dictionaryWithDictionary:_itemDetailModel]; | |
62 | } | |
63 | } | |
64 | ||
65 | @end |