Guest User

Untitled

a guest
Aug 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. UISplitViewController with story board
  2. NSMutableArray *monsters = [NSMutableArray array];
  3. [monsters addObject:[[[feature alloc] initWithName:@"iphone3g"
  4. iconName:@"iphone3g.jpg" featuresofiphone:iphone3gf] autorelease]];
  5.  
  6. [monsters addObject:[[[feature alloc] initWithName:@"iphone3gs"
  7. iconName:@"iphone3gs.jpg" featuresofiphone:iphone3gsf] autorelease]];
  8.  
  9. [monsters addObject:[[[feature alloc] initWithName:@"iphone4g" iconName:@"iphone4g.jpg"
  10. featuresofiphone:iphone4gf] autorelease]];
  11.  
  12. MasterViewController *masterDetailViewController = [[MasterViewController alloc]init];
  13. masterDetailViewController.iphones = iphonesarray;
  14.  
  15. UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
  16. UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
  17. splitViewController.delegate = (id)navigationController.topViewController;
  18. return YES;
  19.  
  20. NSMutableArray *monsters = [NSMutableArray array];
  21. [monsters addObject:[[[feature alloc] initWithName:@"iphone3g"
  22. iconName:@"iphone3g.jpg" featuresofiphone:iphone3gf] autorelease]];
  23.  
  24. [monsters addObject:[[[feature alloc] initWithName:@"iphone3gs"
  25. iconName:@"iphone3gs.jpg" featuresofiphone:iphone3gsf] autorelease]];
  26.  
  27. [monsters addObject:[[[feature alloc] initWithName:@"iphone4g" iconName:@"iphone4g.jpg"
  28. featuresofiphone:iphone4gf] autorelease]];
  29.  
  30. MasterViewController *masterDetailViewController = [[MasterViewController alloc]init];
  31. masterDetailViewController.iphones = iphonesarray;
  32.  
  33. UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
  34. UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
  35. splitViewController.delegate = (id)navigationController.topViewController;
  36. return YES;
  37.  
  38. -(void)viewDidLoad
  39. {
  40. [super viewDidLoad];
  41. // Do any additional setup after loading the view, typically from a nib.
  42. self.detailViewController = (DetailViewController *)
  43. [[self.splitViewController.viewControllers lastObject] topViewController];
  44. [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
  45. animated:NO scrollPosition:UITableViewScrollPositionMiddle];
  46. }
  47.  
  48. -(void)viewDidLoad
  49. {
  50. [super viewDidLoad];
  51. // Do any additional setup after loading the view, typically from a nib.
  52. self.detailViewController = (DetailViewController *)
  53. [[self.splitViewController.viewControllers lastObject] topViewController];
  54. [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
  55. animated:NO scrollPosition:UITableViewScrollPositionMiddle];
  56. }
  57.  
  58. [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionMiddle];
Add Comment
Please, Sign In to add comment