Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.66 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. App delegate allocated object displayed in multiple subviews?
  2. -(void)viewDidLoad {
  3. //Get all the sweets from the parent!
  4.     appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  5.     rivbox = appDelegate.rivbox;
  6.     [self.view addSubview:rivbox];
  7. ...
  8. }
  9.        
  10. -(void)viewWillAppear:(BOOL)animated {
  11.     [super viewWillAppear:animated];
  12.     if(rivbox != nil) {
  13.         [rivbox setDelegate:self];
  14.         [self.view addSubview:rivbox];
  15.     }
  16. }
  17.        
  18. - (void)viewWillAppear:(BOOL)animated {
  19.   //Get all the sweets from the parent!
  20.   appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  21.   [self.view addSubview:appDelegate.rivbox];
  22. ...
  23. }