Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 69

ZutraLife
Code is Art
Profile
Posts: 21
Reg: May 03, 2012
LA
2,910
03/22/13 04:46 PM (12 years ago)

UIButtons and .xib

trying to add a uibutton on top of a buzztouch screen via interface builder(xcode4.6), cannot for the life of me get it to "click", must be something easy, but it seems the button is being blocked, i see it in the simulator but cannot click it, any ideas?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
03/22/13 05:18 PM (12 years ago)
watch the youtube video called "Lets make a plugin". That would be easier than trying to type it all out, lol.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/22/13 05:21 PM (12 years ago)
1) Define the button on the xib file 2) Define the button in your header file 3) Define a method in your implementation file 4) In interface builder, 'draw' a correlation between the 'touch up inside' property of the button, and your "Owner" method (#3) http://www.idev101.com/learn/interface_builder_connections.html It's hard for me to explain specifics; I'm just coming out of doing it all by code to using xib files. I like them, but it's a slightly different mindset. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/22/13 05:22 PM (12 years ago)
And Stobe is right (as usual); the 'lets make a plugin' is very good; got me straightened out quickly. Cheers! -- Smug
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
03/23/13 04:20 AM (12 years ago)
Depends what you want the button to do. Create an ibaction in the .h such as -(IBAction) playSound:(id)sender; Then you will need to create the method in the .m Then hook up the action to the button in the files owner in the nib. I code outside of BT but have never customised a BT app.
 

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.