Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 56 lines (38 sloc) 1.089 kb
2948495 @soffes Initial commit
soffes authored
1 //
2 // SSEditPersonViewController.m
3 // SSToolkit
4 //
5 // Created by Sam Soffes on 9/16/10.
6 // Copyright 2010 Sam Soffes. All rights reserved.
7 //
8
9 #import "SSEditPersonViewController.h"
10
11 @implementation SSEditPersonViewController
12
13 #pragma mark NSObject
14
15 - (id)init {
16 if ((self = [super init])) {
17 self.allowsEditing = YES;
18 self.editing = YES;
19 }
20 return self;
21 }
22
23
24 #pragma mark UIViewController
25
26 - (void)viewDidLoad {
27 [super viewDidLoad];
28
29 self.title = @"Edit Contact";
30
31 UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel:)];
32 self.navigationItem.leftBarButtonItem = cancelButton;
33 [cancelButton release];
34 }
35
36
37 #pragma mark UITableViewController
38
39 - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
40 [super setEditing:editing animated:animated];
41 if (editing == NO) {
42 ABAddressBookSave(self.addressBook, nil);
43
44 [self dismissModalViewControllerAnimated:YES];
45 }
46 }
47
48
49 #pragma mark Actions
50
51 - (void)cancel:(id)sender {
52 [self dismissModalViewControllerAnimated:YES];
53 }
54
55 @end
Something went wrong with that request. Please try again.