@synthesize with UITabBarController?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-05-27T10:46:04Z Indexed on 2010/05/29 0:52 UTC
Read the original article Hit count: 305

Filed under:
|
|

I am curious if there is a good reason I should / should not be using @synthesize for the tabBarController below, or does it not matter?

@implementation ScramAppDelegate
@synthesize window;
@synthesize tabBarController;

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    [self setTabBarController:[[UITabBarController alloc] init]];
    [window addSubview:[tabBarController view]];
    [window makeKeyAndVisible];
    return YES;
}

-(void)dealloc {
    [tabBarController release];
    [self setTabBarController: nil];
    [window release];
    [super dealloc];
}

OR

@implementation ScramAppDelegate
@synthesize window;

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    tabBarController = [[UITabBarController alloc] init];
    [window addSubview:[tabBarController view]];
    [window makeKeyAndVisible];
    return YES;
}

-(void)dealloc {
    [tabBarController release];
    [window release];
    [super dealloc];
}

cheers Gary

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c