objective c - How do you change the add button text instead of a -


the add button comes default masterdetail template in xcode displays + symbol. rather have word "add" instead. tried using following line in viewdidload method:

self.navigationitem.rightbarbuttonitem.title = @"add";

to no avail.

this because bar button has been created uibarbuttonsystemitemadd so:

uibarbuttonitem *addbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemadd target:self action:@selector(insertnewobject:)]; 

you should rewrite line create bar button item title, this:

uibarbuttonitem *addbutton = [[uibarbuttonitem alloc] initwithtitle:@"add" style:uibarbuttonitemstylebordered target:self action:@selector(insertnewobject:)]; 

you can find in viewdidload method of master view controller.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -