{"id":1299,"date":"2012-02-20T10:18:43","date_gmt":"2012-02-20T18:18:43","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=1299"},"modified":"2012-02-20T16:52:59","modified_gmt":"2012-02-21T00:52:59","slug":"xcode-nav-buttons","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=1299","title":{"rendered":"Xcode Nav Buttons"},"content":{"rendered":"<p>You can change the title of the back button and put a rightBarButton on the screen using the following code.<\/p>\n<p>In the &#8211; (void)viewDidLoad method, just after [super viewDidLoad]; put this code.<\/p>\n<p><pre><code class=\"\u2019smaller\u2019 preserve-code-formatting\">\nUIBarButtonItem *backButton =\n&nbsp;&nbsp;&nbsp;&nbsp;UIBarButtonItem *backButton =\n&nbsp;&nbsp;&nbsp;&nbsp;[[UIBarButtonItem alloc] initWithTitle: @&quot;Main&quot;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style: UIBarButtonItemStyleBordered\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target: nil\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: nil];\n&nbsp;&nbsp;&nbsp;&nbsp;self.navigationItem.backBarButtonItem = backButton;\n<\/code><\/pre><\/p>\n<p><pre><code class=\"\u2019smaller\u2019 preserve-code-formatting\">\n&nbsp;&nbsp;&nbsp;&nbsp;UIBarButtonItem *helpButton =\n&nbsp;&nbsp;&nbsp;&nbsp;[[UIBarButtonItem alloc] initWithTitle: @&quot;Help&quot;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style: UIBarButtonItemStylePlain\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target: self\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: @selector(goToHelp)];\n&nbsp;&nbsp;&nbsp;&nbsp;self.navigationItem.rightBarButtonItem = helpButton;\n&nbsp;&nbsp;&nbsp;&nbsp;self.navigationItem.rightBarButtonItem.enabled = YES;\n\n<\/code><\/pre><\/p>\n<p>If you don&#8217;t want a back button use this<br \/>\n<pre><code class=\"preserve-code-formatting\">\n[self.navigationItem setHidesBackButton:YES];\n<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can change the title of the back button and put a rightBarButton on the screen using the following code. In the &#8211; (void)viewDidLoad method, just after [super viewDidLoad]; put this code. UIBarButtonItem *backButton = &nbsp;&nbsp;&nbsp;&nbsp;UIBarButtonItem *backButton = &nbsp;&nbsp;&nbsp;&nbsp;[[UIBarButtonItem alloc] initWithTitle: @&quot;Main&quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style: UIBarButtonItemStyleBordered &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target: nil &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: nil]; &nbsp;&nbsp;&nbsp;&nbsp;self.navigationItem.backBarButtonItem = backButton; &nbsp;&nbsp;&nbsp;&nbsp;UIBarButtonItem *helpButton = &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=1299\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Xcode Nav Buttons<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1299","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1299"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1299\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}