Reputation: 2669
Is there a way to check if the current view already has a right bar button, something like:
if (FOO_CODE.rightBarButtonItem != nil) {
// don't create one
} else {
// create one
}
Upvotes: 1
Views: 1082
Reputation: 2103
if (self.navigationItem.rightBarButtonItem)
has the same effect, testing equality to nil is redundant
Upvotes: 0
Reputation: 21770
if (self.navigationItem.rightBarButtonItem != nil)
{
// I exists
} else {
// I don't exists
}
Upvotes: 3