Developer Area

Changeset 662

Show
Ignore:
Timestamp:
01/17/10 15:24:38 (8 months ago)
Author:
henri
Message:

Changed behavior to display Save and Cancel buttons instead of standard navigation.
Also added title.

Location:
apps/iphone/my.tel/trunk/Classes
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/RecordGroupsController.h

    r612 r662  
    2929 
    3030+ (RecordGroupsController *)controllerForRecord:(NSDictionary *)aRec groups:(NSArray *)aGroupsArray delegate:(id<RecordGroupsDelegate>)aDelegate; 
     31- (void)didPressSave:(id)sender; 
     32- (void)didPressCancel:(id)sender; 
    3133 
    3234@property (nonatomic, retain) id<RecordGroupsDelegate> delegate; 
  • apps/iphone/my.tel/trunk/Classes/RecordGroupsController.m

    r636 r662  
    7171} 
    7272 
    73 #pragma mark ------ UI Methods 
    74  
    75 - (void)viewWillDisappear:(BOOL)animated { 
     73#pragma mark - 
     74#pragma mark view methods 
     75 
     76- (void)viewDidLoad { 
     77        self.title = @"Privacy Groups"; 
     78    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave 
     79                                                                                                                                                                                        target:self 
     80                                                                                                                                                                                        action:@selector(didPressSave:)] autorelease]; 
     81        self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel 
     82                                                                                                                                                                                   target:self 
     83                                                                                                                                                                                   action:@selector(didPressCancel:)] autorelease]; 
     84} 
     85 
     86- (void)dealloc { 
     87    [super dealloc]; 
     88        [theRec release]; 
     89        [selectedGroupsArray release]; 
     90} 
     91 
     92#pragma mark - 
     93#pragma mark Button presses 
     94 
     95- (void)didPressSave:(id)sender { 
    7696        if (ctGroups == 0) { 
    7797                // record is public, return an empty array 
     
    86106        } 
    87107        [delegate replaceGroupsForRecord:theRec withGroups:groupsIdList]; 
    88         [super viewWillDisappear:animated]; 
     108        [self.navigationController popViewControllerAnimated:YES]; 
     109} 
     110 
     111- (void)didPressCancel:(id)sender { 
     112        [self.navigationController popViewControllerAnimated:YES]; 
    89113} 
    90114 
     
    237261} 
    238262 
    239  
    240  
    241 #pragma mark ------ Standard View Methods 
    242  
    243  - (void)viewDidLoad { 
    244          [super viewDidLoad]; 
    245  } 
    246  
    247 - (void)didReceiveMemoryWarning { 
    248     [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 
    249     // Release anything that's not essential, such as cached data 
    250 } 
    251  
    252  
    253 - (void)dealloc { 
    254     [super dealloc]; 
    255         [theRec release]; 
    256         [selectedGroupsArray release]; 
    257 } 
    258  
    259263@end 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us