Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 84

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
06/25/14 10:31 AM (10 years ago)

Question on using Login Screen

Hey guys, quick question... I'm using the login screen plugin, and need to add a button for user registration. All UI elements of the login screen are created programmatically. Because I work better with interface builder instead of hard code, I added a file BT_screen_settingsLogIn.xib, and added and connected a simple button. I connected the view to the code, and connected the button to my IBAction code as well. Everything appears to be great... the login plugin shows as normal, with my button below it. When I connected by button, my IBAction code appeared when I control clicked. Everything looks normal. The problem is, nothing happens when I click the button. I removed all of my custom IBAction code, and just had the IBAction do a simple NSLog statement instead. Still nothing. Is there something in the hard code of the plugin that would prevent any user interaction with the button? What's my best way around this? There's going to be several additional UI Elements on this screen eventually, so hard coding them really isn't the best scenario for me. I even added a simple UIimageView to the xib file to make sure everything was being brought into the xib as it should, and it appeared with no problem. It's almost like something is telling the button to disable user interaction on it, since it won't even display a line in the NSLog. I have checked all of the connections on the button and view more than 10 times, and there's no issue there. referencing outlets are set, custom class is set, button action is set, etc. The code using to test is: -(IBAction)PushForm:(id)sender { NSLog(@"Success!"); } I add XIB's and hook up buttons all the time, no issues. Any ideas on what I should do? FOLLOW-UP: Adding the button programmatically works, so it's not the code. But there will be too many things on this XIB to lay everything out that way. The programmatically added button shows it being clicked with a visible down press. The IB one does not. I made sure under arrangement that it has been brought to the front... it's almost like it's enabled=false or something, but it's not. Still can't figure this one out :(
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/25/14 08:21 PM (10 years ago)
Did you specify "touch up inside"?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
06/25/14 08:30 PM (10 years ago)
Yep, sure did
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/26/14 07:12 AM (10 years ago)
If you haven't fixed it yet, I wrote a quickie on this sort of thing... https://dl.dropboxusercontent.com/u/115208762/EZXibConnect.pdf I'm guessing either step 4/5, or possibly both, but probably just one or the other. Cheers! -- Smug
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
06/26/14 07:17 AM (10 years ago)
What would cause a button to work programmatically, but not when connected through interface builder? I've checked the obvious list... - Button is connected (and recognizes) my IBAction through the "touch up inside" gesture - The code in the IBAction works fine, because IBAction works programmatically - The view is connected and the custom class is set - IBOutlet is defined and recognized, as when I drag my gesture connections, it sees my IBaction name and connects to it (it wouldn't see it if it wasn't defined properly) I even tried adding an extra "button.enbled = true" and "self.button setenabled = true" to the end of my viewdidload, to make sure it wasn't getting turned off somehow. It's really strange. IB button doesn't even show the press action when you tap it. The programmatically created one shows the press and does the function just fine. I've never ran into this before.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
06/26/14 07:21 AM (10 years ago)
Cool Smug, thanks, I'll run through the list and see what I can track down. It's almost like something in the loginscreen plugin is disabling the button.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/26/14 07:30 AM (10 years ago)
Smug -- I've made a Smug collection within iBooks to hold your treasure trove! Thank you! -- Niraj
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/26/14 07:34 AM (10 years ago)
Hmmm... well, if 'parts' of the xib work, but the button does not, then anything I've suggested has been eliminated as a cause. I mistook that 'nothing' was working. I'm more comfortable in interface builder too. When I build screens 'programatically' what I've done is used 'Dapp' (a UI building app, http://dapp.kerofrog.com.au) and have it generate code rather than xibs for the UI. But for a xib button to work, you'll need to: declare it in your header, twice; once within the declaration brackets, and once with the properties... declare the method in the properties area of the header file... use the method within the implementation file... hmm... other than that, I can't think of anything, and it 'sounds' like you've looked through all that... so 'maybe' it doesn't like IB buttons in it... if it's not completely a 'xib' oriented plugin... I suppose you could write down all the sizes and settings of the IB Button and recreate it programatically... a little more trouble perhaps, but certain success would be assured... Anyway, good luck and let us know how it turns out... Cheers! -- Smug
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
06/26/14 08:17 AM (10 years ago)
Yeah, I think thats what I'm going to have to do. With the iPhone 6 coming out, I was hoping to have everything interface builder XIB based, so I could create different sized XIB's if needed if they give us a surprise on a new screen resolution for the optional larger iphone 6 model. From what I have heard though, I think the screen resolution will remain the same (i hope, lol). Since this is also just the login screen, maybe I can move some of the other items to a different view. I was going to have some of the "manage my account" stuff appear below the login stuff once logged in, but I could push that to the next screen so that it's easier to layout in IB.
 

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.