Guest User

Untitled

a guest
Jul 18th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. - (id)initWithStyle:(UITableViewStyle)style
  2. {
  3. self = [super initWithStyle:style];
  4. if (self) {
  5. NSLog(@"CALLED");
  6. // Custom initialization
  7. _dropDownSelection = [[VPPDropDown alloc] initSelectionWithTitle:@"Selection Combo"
  8. tableView:self.tableView
  9. indexPath:[NSIndexPath indexPathForRow:kRowDropDownSelection inSection:kSection1]
  10. delegate:self
  11. selectedIndex:1
  12. elementTitles:@"Option 1", @"Option 2", @"Option 3", nil];
  13.  
  14. _dropDownDisclosure = [[VPPDropDown alloc] initDisclosureWithTitle:@"Disclosure Combo"
  15. tableView:self.tableView
  16. indexPath:[NSIndexPath indexPathForRow:kRowDropDownDisclosure inSection:kSection1]
  17. delegate:self
  18. elementTitles:@"Disclosure 1", @"Disclosure 2", @"Disclosure 3", @"Disclosure 4", @"Disclosure 5", nil];
  19.  
  20.  
  21. NSMutableArray *elts = [NSMutableArray array];
  22. for (int i = 1; i <= 4; i++) {
  23. // just some mock elements
  24. VPPDropDownElement *e = [[VPPDropDownElement alloc] initWithTitle:[NSString stringWithFormat:@"Element %d",i] andObject:[NSNumber numberWithInt:i]];
  25. [elts addObject:e];
  26. }
  27.  
  28. _dropDownCustom = [[VPPDropDown alloc] initWithTitle:@"Custom Combo"
  29. type:VPPDropDownTypeCustom
  30. tableView:self.tableView
  31. indexPath:[NSIndexPath indexPathForRow:kRowDropDownCustom inSection:kSection2]
  32. elements:elts
  33. delegate:self];
  34. }
  35. return self;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment