0

How come doing

[self.navigationController setToolbarHidden:NO];

works (shows the toolbar)

but setting on the view directly

self.navigationController.toolbar.hidden = NO;

doesn't?

Avba
  • 14,822
  • 20
  • 92
  • 192

1 Answers1

0

This is really an academic question.

Apple has chosen to implement some UI features not as strict properties, even if they almost look like properties and often behave as such. This is what is confusing you.

In this particular case

[self.navigationController setToolbarHidden:NO];

is really short for

[self.navigationController setToolbarHidden:NO animated:NO];

i.e. there are some user interface considerations in addition to just changing a property of one item in the view hierarchy, so the method has to be called.

Mundi
  • 79,884
  • 17
  • 117
  • 140