Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 12    Views: 56

Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
06/22/14 04:01 AM (10 years ago)

Chris - Xib button assistance if possible please..

Hi Chris, Just a quicky please.. I am using xib button for a menu in a current live app. I need to add a button for further functionality, however I have deleted all the buttons that were not in use. How do i reinstall a button that will then correspond with the cp please? I have tried to no avail. I have even added my own piece of code which worked but took the user out of the app, ie to a website through safari. Many thanks, much appreciated. Alex
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 07:08 AM (10 years ago)
What further functionality did you need? You could re download the package again.. To make a button work with the control panel, the app would need to made on self hosted then you would need to make a html file, add it in the list of custom "screens" in bt_config.txt. This would all be done in that screens self hosted package that you download off of your account in plugin section. Its pretty easy, depends on what you want to be done though. Smug has how to on how to connect it to the control panel: https://www.buzztouch.com/files/howtos/CP2Project.pdf Ill help if you want to after you go through this doc and understand a little more
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
06/22/14 07:45 AM (10 years ago)
Sorry, you've missed what I am saying. I currently have an app live on the App Store. It uses the xib button menu upon loading. It utilises 4 buttons. I deleted those that I didn't need. I now need to reinstate a button. I'm unsure how to connect the a new button to the code and thus the cp. It might be that I need to reinstall the plugin and start again but it would be a lot easier adding a single button...apparently not! The new screen would be in custom URL as opposed to HTML. Thanks
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 09:18 AM (10 years ago)
I understood you. You use an html file to connect code to the control panel.sorry I wasnt clear on what I meant.I meant if the plugin already comes with those buttons connected to the cp you can download your app project again. Then delete the three you dont need. I just thought about this but if the buttons do come with the ok gin originally.you can look at how they connected the plugin by liiking at yhe self hoated package or downloading a new copy of the app.also smugs how to shows you how to do this too
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 09:26 AM (10 years ago)
Ok i just seen it was that xib button plugin.canr you add another buttob in the cp and it will show up when refreshed? I havent used it before
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
06/22/14 09:33 AM (10 years ago)
No, if I add a new button it doesn't do anything so must be a way to connect to the code. If I duplicate a button it acts as that button.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 12:17 PM (10 years ago)
d When you right click on the button you dupkicated does it have a white xircle next to toucg up inside?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
06/22/14 12:46 PM (10 years ago)
The issue is that objects added to a xib file need to be 'connected' to the code (usually the .h file). There's a couple ways to do this. Probably easier to look up a how-to on YouTube than have me explain it. I think I even have a YouTube video showing this on my channel. Normally you don't need this with the xib plugin because it comes with a dozen buttons already connected. Note: you may want to consider using the Ultimate Screen Creator plugin instead - it makes adding buttons and a host of other elements much easier!
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 01:09 PM (10 years ago)
from reading the description this is how I think it works.im going to buy it now just because im interested ha. so im guessing theres twelve sections in the control panel wgere you enter what screen you want to open when clicked.then I guess in menuButtons.m there is aethod like this for each button -(IBAction)doPicBtn:(id)sender; but instead of doPicButton it would be the name of the button.then go the menu button xib and click file inspector so you can see xib on the left and menuButton.m on the right.right click on the button on the xib . a little black screen will appear.right next to "touch up inside" there is a black circle .drag the circle to the code of that button.so if you cofigured button 7 to open the custom url drag the circle to -(IBAction)buttn7:(id)sender; or whatever the name of button 7 method is
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 01:11 PM (10 years ago)
Dang I ljust noticed you answered chris1 lol.it took me like ten min to write that on my phone ha
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
06/22/14 01:24 PM (10 years ago)
Thanks guys, Chris, Im completely fine with stand alone button calls, such as .h -(IBAction) pressButton:(id) sender; .m -(IBAction) pressButton { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http:website"]]; } I can do this to the xib button menu - the issue being that the button goes to a website and doing it my way it takes you out of the app. Is there not a simple way to add a button back to the code? Thanks!
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/22/14 04:28 PM (10 years ago)
Sorry you mentioned that and I still was trying to explain something new ha . You could do this: http://stackoverflow.com/questions/5215666/going-to-a-uiwebview-from-an-ibaction Im about to purchase the plugin and see though.the social features of it is perfect for one of my apps Ill pm you as we dont want to reveal plugin code on here
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
06/23/14 04:40 AM (10 years ago)
An update! I disconnected all the buttons and programmed them myself. This give me much more flexibility if I need to add any in the future. For info, for the web views i simply added new .h and .m files with nibs and directed the buttons to them. Weirdly, if pressed first, this stopped the xib menu buttons from working! So I was forced to program the rest too! However, I'm really pleased as I have a nice hybrid of bt and my own work going on here! Thanks for the help! Alex
 

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.