last day (14 days later) » 

12:26 AM
0
Q: button click action not getting triggered in xcode

Jikku Joseph JohnI have created a single view application in xcode. I added a button and a textbox to mainstoryboard. And I added a touch inside event. But when I run the simulator, the function/IBAction associated with the touch inside event is not getting fired for some reason when I click the button. Any clue...

 
Can you post the code in your IBAction? How do you know it is not being fired?
 
I placed a breakpoint inside the IBAction. Also I tried to set the value for another label on the same view inside the IBAction. Neither works.

I have edited the question to include the code inside the IBAction and also the file drop location for the xcode project.
 
I just tried your code on my machine. It works fine.
 
What does the label text show cuz when I run it the label doesnt change
 
Whatever text has been entered into the textfield.
 
12:26 AM
Did you run my project as a whole or did you just paste the IBAction into your own project?
 
Nope. Ran the project as a whole. How are you testing your code in the simulator that may be different?
 
I am running iPhone 6.1 simulator
xcode 4.6
 
Okay. Note that I had to run your app in landscape in order to enter the textfield and press the button, as you aren't yet clearing the keyboard when the return button is pressed.
 
Yep. I am running it in landscape too.
 
And does anything happen when you press the button?
 
12:32 AM
I type into the textbox and then click the button but the label 'Test' doesnt change. Nothing happens when I click the button
 
Are you sure that the IBAction is hooked up correctly? Also, are you certain that log statements are not showing up in any part of the console.
?
 
Well if the project I uploaded works perfectly fine as is on your machine, doesnt that indicate the IBAction is hooked up correctly?
 
Definitely. I'm just not sure what more I can offer you without physically peering over you r shoulder to look at the code. :)
You may want to try clearing out the simulator with "Reset Content and Settings", and restarting Xcode.
 
Tried the same 'Reset content and settings' but still doesn't work
Are you using the iPhone 6.1 simulator?
 
Yes
Sorry, man. Afraid there's not much more I can do to help you. Good luck.
 
12:48 AM
Thanks. You did your best
 

last day (14 days later) »