you should set the title to UIButton, not UIBarButtonItem
[backToRecent setTitle:@"Recent" forState:UIControlStateNormal];
and itβs not good to make the same variable and method name
[backToRecent addTarget:self action:@selector(backToRecent) forControlEvents:UIControlEventTouchUpInside];
it does not work because you use
[backToRecent setImage:[UIImage imageNamed:@"back.png"]forState:UIControlStateNormal];
try using
[backToRecent setBackgroundImage:[UIImage imageNamed:@"back.png"]forState:UIControlStateNormal];
source
share