Home News Forum Social Networking Support Us Advertise

Spanish Lesson 1 ($1.99)

aWake!Gently ($1.99)

The Bird & The Snail - Knock Knock - Deluxe ($4.99)

Match-It Trains ($0.99)

Tangled ($0.99)

iFlatter ($0.99)

The 15 puzzle ($0.99)

Tap Forms Database ($8.99)

Higher or Lower Card Game (Hi Lo) ($0.99)

Red Pixel ($0.99)

Time-Shift Radio ($0.99)

Want your application advertised here? Only $10/week!

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-02-2008, 01:05 PM   #1 (permalink)
Senior Member
 
Join Date: Aug 2008
Posts: 135
Rep Power: 1
peejavery is on a distinguished road
Default Change left navigation button from text to image

When pushing a new view controller, the "back" button uses the title of the previous view. Is there a way to make it so that it is UIBarButtonSystemItemBookmarks instead?

I've tried the following but it doesn't work.

Code:
UIBarButtonSystemItem btnItem = UIBarButtonSystemItemBookmarks;
UIBarButtonItem *btnSearch = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:btnItem target:self action:self.navigationItem.leftBarButtonItem.action];
self.navigationItem.leftBarButtonItem = btnSearch;
peejavery is offline   Reply With Quote
Old 10-02-2008, 04:02 PM   #2 (permalink)
Senior Member
 
Join Date: Aug 2008
Posts: 135
Rep Power: 1
peejavery is on a distinguished road
Default

Anyone got ideas?
peejavery is offline   Reply With Quote
Old 10-03-2008, 10:09 AM   #3 (permalink)
Mobile Geek
 
Join Date: Aug 2008
Location: Florida, USA
Posts: 350
Rep Power: 1
rames44 is on a distinguished road
Send a message via AIM to rames44 Send a message via Yahoo to rames44
Default

When you say "didn't work" do you mean that it didn't display as you wanted? Or that it didn't give you the result you expected? It looks like you've installed it correctly (so I would expect it to display) but you haven't configured it properly, so I would not expect it to work when pressed.

The one thing I noticed odd was the "action" you supplied when creating the BarButtonItem. Normally, the init code should look like:
Code:
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:btnItem target:self action:@selector(myMethod)];
where "myMethod" is a member function on the view controller that's setting this ("self") up.

What you've done is said that the target object (the object that will be called when the button is pressed) is "self", but that the action (the actual method that will be called) is whatever method (heaven only knows what) that was on the original left button item. Your view controller ("self") almost certainly doesn't implement a method by that name (whatever it is), so when the button is pressed, the system's not going to be able to call anything rational - it won't find the method, so probably nothing will happen.
rames44 is offline   Reply With Quote
Old 10-03-2008, 12:00 PM   #4 (permalink)
Senior Member
 
Join Date: Aug 2008
Posts: 135
Rep Power: 1
peejavery is on a distinguished road
Default

I think you're missing my point. I have no problem creating navigation buttons. I need to customize the "Back" button so that it isn't a text button, but an image. See attached image.

Attached Images
File Type: jpg navigation.jpg (10.7 KB, 100 views)
peejavery is offline   Reply With Quote
Old 10-04-2008, 08:45 AM   #5 (permalink)
Senior Member
 
Join Date: Aug 2008
Posts: 135
Rep Power: 1
peejavery is on a distinguished road
Default

Anyone else have ideas?
peejavery is offline   Reply With Quote
Old 10-04-2008, 10:26 AM   #6 (permalink)
Mobile Geek
 
Join Date: Aug 2008
Location: Florida, USA
Posts: 350
Rep Power: 1
rames44 is on a distinguished road
Send a message via AIM to rames44 Send a message via Yahoo to rames44
Default

OK, I misunderstood what you were getting at.

Instead of using the "backButtonItem", have you tried using "leftBarButtonItem"? Possibly in combination with "hidesBackButton"?
rames44 is offline   Reply With Quote
Old 10-08-2008, 10:48 AM   #7 (permalink)
Senior Member
 
Join Date: Aug 2008
Posts: 135
Rep Power: 1
peejavery is on a distinguished road
Default

Thanks for you replies.

I re-created my GUI about a day after that problem. In doing so, I no longer need this solution.
peejavery is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements


» Stats
Members: 8,231
Threads: 20,199
Posts: 90,216
Top Poster: RickMaddy (2,121)
Welcome to our newest member, OneGlobe
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:34 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0