Skip to content

Instantly share code, notes, and snippets.

@leongersing
Created September 5, 2010 22:09
Show Gist options
  • Save leongersing/566372 to your computer and use it in GitHub Desktop.
Save leongersing/566372 to your computer and use it in GitHub Desktop.
Fields------------------------------------------
@interface SubViewController : UIViewController {
MyAppDelegate *appDelegate;
}
@end
@implementation SubViewController
- (void)dealloc {
[appDelegate release]; appDelegate = nil;
[super dealloc];
}
- (void)viewDidLoad {
[super viewDidLoad];
appDelegate = [(FireAppDelegate *)[[UIApplication sharedApplication] delegate] retain];
}
@end
Properties---------------------------------------
@interface SubViewController : UIViewController {
}
@property(nonatomic,retain) MyAppDelegate *appDelegate;
@end
@implementation SubViewController
@synthesize
- (void)dealloc {
[appDelegate release]; appDelegate = nil;
[super dealloc];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.appDelegate = (FireAppDelegate *)[[UIApplication sharedApplication] delegate];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment