
Untitled
By: a guest on
May 10th, 2012 | syntax:
None | size: 0.66 KB | hits: 14 | expires: Never
App delegate allocated object displayed in multiple subviews?
-(void)viewDidLoad {
//Get all the sweets from the parent!
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
rivbox = appDelegate.rivbox;
[self.view addSubview:rivbox];
...
}
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if(rivbox != nil) {
[rivbox setDelegate:self];
[self.view addSubview:rivbox];
}
}
- (void)viewWillAppear:(BOOL)animated {
//Get all the sweets from the parent!
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[self.view addSubview:appDelegate.rivbox];
...
}