AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
10/30/12 12:22 PM (13 years ago)

Add toolbar button

Hi, Does anyone know how to add a toolbar button that launches either another screen or a revmob ad link? (Note: I've managed to create the button but not to get it to launch another screen or revmob ad link) Thanks
 
denikov
Lost but trying
Profile
Posts: 46
Reg: Dec 26, 2011
Reno Nevada
10,360
like
10/30/12 02:01 PM (13 years ago)
following...would like to know this too. i think there's some hard coding involved in eclipse and xcode.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
10/30/12 02:42 PM (13 years ago)
Cant you add a button to the top navigation bar and link that to a screen you like??
 
AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
like
10/30/12 02:46 PM (13 years ago)
Yeah that's what I'm doing now but I want to get rid of nav bar
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
10/30/12 02:50 PM (13 years ago)
Well where exactly should your button go then? Button Menu is no option?
 
AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
like
10/30/12 03:00 PM (13 years ago)
On the toolbar!
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
10/30/12 03:08 PM (13 years ago)
Ok dont get it then. If you dont want the top nav bar to show, no clue where a toolbar should be.
 
AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
like
10/30/12 03:12 PM (13 years ago)
On some screens like the new paint plugin there's a bottom bar with buttons called the toolbar.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
10/30/12 03:17 PM (13 years ago)
Well, lets call it bottom bar then. If you can already display the button, then I would copy the code from the top nav bar buttons. Could work that way. If not, maybe write Mr. David a message, maybe he has time to help you out here. Good luck.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
10/30/12 10:24 PM (13 years ago)
Could you use the button menu? The button can be transparent.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
10/31/12 07:24 AM (13 years ago)
A UIToolbar on the bottom of the screen that you can add buttons too? You'll probably need to make a plug-in. Start with a blank screen and use Interface Builder to drop a UIToolbar on the view. Then you can add buttons to the toolbar and link up IBActions to the buttons, such as a method to 'load screen' or 'show revmob ad'. David's 'build a plug-in video' will show you how to link the button to a screen. Revmob should have some code to present an add modially. and keep in mind UIToolbar button items act a little differently than regular buttons. You don't have to worry about the 'touch up inside' stuff, just link the selector to the action.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
10/31/12 08:16 AM (13 years ago)
@Atrain53 has the right idea. If you watch David's video it will tell you what to do.
 
AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
like
10/31/12 11:00 AM (13 years ago)
@Atrain53 - yep there's already a toolbar and I know how to bring some actions but I've tried to load a revmob ad link or another screen and I can't work it out. So far I have: UIBarButtonItem* button_5 = [[UIBarButtonItem alloc] initWithTitle:@"Free Games" style:UIBarButtonItemStylePlain target:self action:@selector() ]; button_5.style = UIBarButtonItemStyleBordered; [buttons addObject:button_5]; [button_5 release]; So in that 'action:@selector(x) ];' bit I think you're referring to, how do I load a screen or call a revmob ad link? @SusanMetoxen - I think plugin development is a bit beyond me but I will check out the video :)
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
10/31/12 12:16 PM (13 years ago)
you're close! inside that @selector() is where you reference the method you're calling when the button is clicked. like @selector(nameofmethodtocallwheniclickthisbutton:)]; this is mostly navigation based, but a good tutorial that explains it better than i can. tons of great tutorials out there. start small and think "hello world" before you try revmob actions. <a href="http://www.roseindia.net/tutorial/iphone/examples/iphone-NavigationAdToolBar.html" target="_blank" rel="nofollow">http://www.roseindia.net/tutorial/iphone/examples/iphone-NavigationAdToolBar.html</a> roseindia is a great site for learning ios not beyond you if you keep studying ;) Davids videos are AWESOME.
 
AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
like
10/31/12 09:03 PM (13 years ago)
Thanks for the encouragement Atrain53. Yeah that's what I meant, what is the name of the method to a call a new screen or a revmob ad link because I tried inserting what I thought the methods were inside the @selector(nameofmethodtocallwheniclickthisbutton:)]; and didn't work. Anyway, if anyone knows let me know, and I'll check out those links :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.