You are releasing the actionBar
instance and just retaining its view
. If actionBar
instance is responder to button action, then button click message is getting sent to deleted instance. You should retain the actionBar
instance. One way to do this is making it an ivar or a retain
property.
Also looks like you are creating a UIViewController
for a custom view. Instead you can create just a custom UIView
with its XIB.
EDIT
Declare retain property,
@property (nonatomic, retain) ActionBarWithLogoff *actionBar;
OR
Simply declare as ivar,
@interface YourViewController: UIViewController {
ActionBarWithLogoff *actionBar;
}
And in dealloc
method,
-(void) dealloc {
//...
[actionBar release];
//...
}
Hope that helps!