I am trying to track down a zombie, I have run the application with NSZombies enabled. A message is being send to a deallocated object in BookEventViewController (code below).
the crash happens when moving from through the UITabBar buttons. BookEventViewController is not on the uiTabBar it is navigated to from EventsTableViewController that is on the TabBarController.
the crash only happens when you have navigated from EventsTableViewController to BookEventViewController and then press the tabButtons.
I am struggling to see exactly what I am doing wrong. I have looked at the out put from the instruments and the zombie is caused by
[UiNavigationController viewWillApear]
it is at this point I am stuck any ideas greatly appreciated
here is my class
@implementation BookEventViewController
@synthesize _Image,dateLabel,titleLabel,details,dresscode,Type,capacity,rsvp,runtime,location,price,bookButton,alert,starttime;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.hidesBottomBarWhenPushed=NO;
self.navigationController.delegate=self;
self.tabBarController.delegate=self;
}
return self;
}
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
// NSLog(@"nav called");
self.tabBarController.tabBar.hidden=NO; //hides tabbar of parent view
self.hidesBottomBarWhenPushed=NO;
}
-(void)dealloc
{
self.navigationController.delegate=nil;
self.tabBarController.delegate=nil;
}
-(void)viewWillAppear:(BOOL)animated
{
self.tabBarController.tabBar.hidden=YES;
[self loadDataFromDb];
}
- (void)viewDidLoad
{
[super viewDidLoad];
_Image.image=[UIImage imageNamed:@"drinksimg"];
_Image.clipsToBounds=YES;
self.navigationController.delegate=self;
self.tabBarController.tabBar.hidden=YES;
UISwipeGestureRecognizer *vertical=[[UISwipeGestureRecognizer alloc]
initWithTarget:self
action:@selector(back)];
vertical.direction=UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:vertical];
[Functions setFontFamily:@"Neutra Display" forView:self.view andSubView:YES];
regist=0;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
and here is the out put from the interments
#Event Type ∆ RefCt RefCt Timestamp Responsible Library Responsible Caller
162 Zombie -1 00:20.374.056 UIKit -[UINavigationController viewWillAppear:]