Getting Object allocation at UIBarButtons
- by Rani
Hi guys,
I'm getting allocation at UIBarbutton that i added to toolbar.
masterviewcontroller.h
UIBarButtonItem *markReadItems;
UIBarButtonItem *markUnReadItems;
UIBarButtonItem *refreshItems
masterviewcontroller.m
-(id)init{
if(self = [super init]){
refreshItems = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshItems)];
markReadItems = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(markAllAsRead)];
markUnReadItems = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(markAllAsUnRead)];
}
return self;
}
-(UIToolbar*)getToolbar
{
NSArray *items = [NSArray arrayWithObjects:refreshItems,markReadItems,markUnReadItems,nil];
[__toolBar setItems:items animated:NO];
}
- (void)dealloc {
[refreshItems release];
[markReadItems release]; [markUnReadItems release];
}
Can any one help me to solve this.
Thanks in advance.