iOS Objective-C UIButton action not working correctly - iphone

I am making a simple application for iphone (for learning and education purposes). Inside the .XIB file there is a button used to clear all text fields on the screen. I create a "clear:" method for the button. assign the method to "Touch Up Inside", but when I run the app in iOS Simulator the button acts like the "clear:" method has been assigned to "Touch Up Outside". I click the button nothing happens, I click and hold the button then drag my mouse pointer outside of the button and let go and all text fields clear. Can anyone help me make it so "Touch Up Inside" works properly? (If I am completely mistaken, and sound like a noob just tell me, I am a beginner)

Are you sure you have it hooked up correctly to TouchUpInside? Try deleting that Send Event association, and redoing it.
It should look something like this:

Related

Unity Add Shooting Controller - easy one

I am very new to unity, and still learning how to create games and edit scripts, so this will probably be easy for anyone to answer. I don't really know what you want to see.
I have a script for using the left mouse button to fire. I want to add one for the right mouse button.
What I've done:
I copied the script that calls the objects and changed the name to Fires.
I added the controller button
I copied the same lines for Fire (original) in the Input manager script. changed the names to Fires.
The problem: pressing right mouse button doesn't do anything. If I use the Input Manager to call Fires, it works, but not when I press the button. I'm missing something, but I'm not sure what.
Any help would be appreciated.

segue code crashes after all tasks are done?

I am doing this for an online class. The code seems to be the same as the instructor’s, which is working in their video. Yet, every time I run it, it updates the text field in the second view controller, then crashes. All this app is supposed to do is take an input in the text box on the first screen and display it in the label on the second screen after the user presses the “button” button.
Here’s the link to the entire file (it’s a very simple program).
https://drive.google.com/open?id=1Cn2OD18vdy7OoQ6bRWjK-Fq2MPaMVc1v
You have attached something and removed it from viewcontroller. That's why storyboard was looking for reference of it. You have to remove that reference from storyboard also, Please have a look in this screenshot. Remove warning sign variable and run your application.

XCode 10 adding action to button

I'm trying to make a Cocoa app with buttons that run simple command line scripts.
I can't seem to figure out how to add the action to my button.
I've read some docs that suggest holding down option and dragging the button into controller code but I think they are out of date. Can someone suggest how to get there from this screenshot?
You need to first select your button, then hold the control ⌃ button on your keyboard and then drag that across to your view controller. That will then give you the option of what to name your method etc.
Actually I had the same problem and the root cause was just the drag method. From the descriptions I had assumed that I need to press CTL and then drag while having the left mouse button pressed. This did not work at all (in my environment). Then I noticed that "it works" with the right mouse button. But the result was not correct. (E.g. I could not get "Action"). Finally I found: I have to use the right mouse button only for dragging without holding CTL. Then I got the correct result.

How do I get a pop-up to display on my iphone application?

I would like to know how to display a pop-up with some text, in an iphone application that I am developing. The part of the app I am talking about consists of some text pulled in from a plist file, all this happens in a view controller object which also consists of a button. When the user presses the button, I would like to show a pop-up window (not a small alert like the one obtained using UIAlertView but one similar to the pop-up ads that appear when you launch certain apps on the iphone, with the background dim and a window with a close button etc etc..), ya so anyway I would like to know how to achieve this, mainly if there is any pre-defined class that can make this happen. Any help would be highly appreciated. Thanks in advance.
You could use MBProgressHUD for this. You can add custom views in it and it also has the dimBackground property to dim the containing view and many other useful things.

how to do tooltip on button in iphone?

I am having download icon on my page i want that when the user takes his finger over the button a tooltip should show as showing download in text.
is there any option in iphone to show a tooltip???
Dan is absolutely right on how to do it but I'd answer you should rethink your design to not need the tooltip at all.
There's a reason that there isn't one by default - what if the user presses down on the button to see what it does, reads the tooltip and realises that's not what they want. They then have to be very careful not to let go while still over the button or it will press and do the wrong thing. (And most users don't know that they can press down over a button, move their finger off it and release it to cancel the press.)
You should rethink your design to make it obvious what the buttons do without the user having to interact with them first.
However, if you definitely still want a tooltip, Dan's method is fine.
Nothing built-in, no. If you think about it, generally a tooltip appears when you mouse over the target item. There's no "mousing over" with a touch interface.
You can definitely roll your own, though. Start by placing a view containing your tooltip contents exactly where you want it with an alpha of 0%. Make a custom button with no content that outlines your download icon, and hook its "touch down inside" action to a method that animates the tooltip view to an alpha of 100%. Hook your button's "touch up inside" , "touch down outside" and "touch up outside" actions (and maybe some others--you might want to experiment with that) to a method that animates the tooltip view back to an alpha of 0%.
There isn't native support for this in iOS. But you can create your own.
I ended up creating my custom tooltip/popover class.
Can be initalised with any content view and dynamically adjusts it's frame.
Hope it helps.
https://github.com/akeara/AKETooltip