tags:

views:

95

answers:

1

hi, i have one function in app delegate the function has code in appdelegate.m

  OthersController *mm_OthersController = [[OthersController alloc] init];


  [mm_OthersController toggle_OF: mm_OthersController];
   [mm_OthersController release];

the toggle_OF function is in OthersController.m file which has been set in IB for tab bar item...

-(void)toggle_OF:(OthersController *)con
 {

[con.toolbar removeFromSuperview];
}

the break point goes perfectly...but tool bar cannot be removed......this function is called perfectly if i call within the OthersController.m

A: 

You can simplify things first and check if it then works;

OthersController *mm_OthersController = [[OthersController alloc] init];

[mm_OthersController toggle_OF];
[mm_OthersController release];

You don't have to give the parameter if using the function from inside the controller

-(void)toggle_OF
{
    [self.toolbar removeFromSuperview];
}

Probably will not solve your entire problem, but makes the code a bit cleaner.

MrThys
i tried your code already ..it did not work.....
Mikhail Naimy
put breakpoint into your toggle_OF method and check if self.toolbar is not nil.
Morion
i did it too also...
Mikhail Naimy