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

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

python - Received unregistered task using Celery with Django -