Created
January 6, 2014 03:06
-
-
Save Sunnyztj/8277612 to your computer and use it in GitHub Desktop.
QuickDialog add a object to QSelectSection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QSection *sec2 = [[[QSection alloc] initWithTitle:@""] autorelease]; | |
[root addSection:sec2]; | |
QButtonElement *buttonElement1 = [[QButtonElement alloc] initWithTitle:@"Done"]; | |
buttonElement1.key = @"Done"; | |
buttonElement1.onSelected = ^(void) { | |
NSMutableDictionary* d = [[NSMutableDictionary alloc] init]; | |
[root fetchValueIntoObject:d]; | |
QSelectSection* sec = (QSelectSection*)[self.root sectionWithKey:@"Addresses"]; | |
if ([d objectForKey:@"New Address"]) { | |
[sec addOption:[d objectForKey:@"New Address"]]; | |
[sec.selectedIndexes addObject:[NSNumber numberWithInt:sec.items.count-1]]; | |
[self.quickDialogTableView reloadData]; | |
} | |
[self popToPreviousRootElement]; | |
}; | |
[sec2 addElement:buttonElement1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment