code_junkie

On OS X, seperating a GUI into multiple NIB files and NSView subclasses

Nov 13th, 2011
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. - (void)_setAccessoryViewControllerFromTag:(NSInteger)tag;
  2. {
  3. if ( _accessoryContentViewController != nil )
  4. {
  5. [self setNextResponder:[_accessoryContentViewController nextResponder]];
  6. [_accessoryContentViewController release];
  7. }
  8.  
  9. switch ( tag )
  10. {
  11. case 0:
  12. _accessoryContentViewController = [[RLGraphsViewController alloc] initWithNibName:@"GraphsView" bundle:nil];
  13. break;
  14. case 1:
  15. _accessoryContentViewController = [[RLSummaryViewController alloc] initWithNibName:@"SummaryView" bundle:nil];
  16. break;
  17. case 2:
  18. _accessoryContentViewController = [[RLEquipmentViewController alloc] initWithNibName:@"EquipmentView" bundle:nil];
  19. break;
  20. default:
  21. _accessoryContentViewController = [[RLLocationsViewController alloc] initWithNibName:@"LocationsView" bundle:nil];
  22. break;
  23. }
  24.  
  25. [_accessoryContentViewController setNextResponder:[self nextResponder]];
  26. [self setNextResponder:_accessoryContentViewController];
  27. [self.accessoryView setContentView:[_accessoryContentViewController view]];
  28. }
Add Comment
Please, Sign In to add comment