I have a Tab bar application. and in one of the tab bars I have a navigation contorller. Im trying to set a UIButton with an image as the right button the navigation bar.
I ended up doing this
UIButton *refreshButton = [[UIButton alloc] initWithFrame:CGRectMake(292, 9, 27, 27)];
[refreshButton setImage:[UIImage imageNamed:@"refresh_icon.png"] forState:UIControlStateNormal];
[refreshButton addTarget:self action:@selector(refresh) forControlEvents:UIControlEventTouchUpInside];
[self.navigationController.navigationBar addSubview:refreshButton];
[refreshButton release];
It works fine now but I am not really sure if this is the right way of doing it.