With credit to @lnafziger, @MindSpiker, @vishal, et. al,
The simplest one liner that I arrived at for a single right (or left) bar button is:
self.navigationItem.rightBarButtonItem = <#StateExpression#>
? <#StrongPropertyButton#> : nil;
As in:
@interface MyClass()
@property (strong, nonatomic) IBOutlet UIBarButtonItem *<#StrongPropertyButton#>;
@end
@implementation
- (void) updateState
{
self.navigationItem.rightBarButtonItem = <#StateExpression#>
? <#StrongPropertyButton#> : nil;
}
@end
I tested this and it works for me (with the strong bar button item wired via IB).