Addressing a memory leak stops my UI from showing iphone
Posted
by dubbeat
on Stack Overflow
See other posts from Stack Overflow
or by dubbeat
Published on 2010-04-29T10:02:01Z
Indexed on
2010/04/29
10:07 UTC
Read the original article
Hit count: 348
iphone
|memory-leaks
Hi
I've being getting a memory leak warning with a UITabbarcontroller.
If I release the tabbarcontroller the warning goes away but the tabbar will not show any content. If I debug the app with the warning still in it the app runs but will crash after a couple of minutes
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.view.frame = CGRectMake(0, 0, 320, 460);
tabBarController.viewControllers=localControllersArray;
// Clean up objects we don't need anymore
[promoTabOptionHome release];
[promoTabOptionInfo release];
[promoTabOptionEvents release];
[promoTabOptionBuy release];
[localControllersArray release];
// Finally, add the tab controller view to the parent view
[self.view addSubview:tabBarController.view];
//[tabBarController release]; commenting out this line removes the warning but results in no content being shown
© Stack Overflow or respective owner