What's wrong? Simple button click to put input on to label

I'm trying to build a simple application with an input box, button, and label.
Clicking the button should take the input box contents and display it upon the label. However, although I have no bugs listed, clicking the button in the app does nothing.
I have in my .h file:
@interface VTViewController : UIViewController
    IBOutlet UITextField *input;
    IBOutlet UILabel *label;
    NSString *contentStore;
-(IBAction)button;
and in my .m file:
#import "VTViewController.h"
@interface VTViewController ()
@end
@implementation VTViewController
-(IBAction)button
    [input resignFirstResponder];
    contentStore = input.text;
    label.text = contentStore;

Put a breakpoint in the button method to verify the IBAction is being triggered.
Make sure the IBOutlets are hooked up, for example it should look like this in the Connections Inspector.
It looks like you hand-rolled this rather than Ctrl+dragging the controls into the header. Normally the IBOutlets are synthesized properties, and the button method should have a parameter.
- (IBAction)buttonPushed:(id)sender {

Similar Messages

  • Problem with a simple button click Xcode IphoneSDK

    not sure what i am doing wrong here. I just want a button to nslog a string.
    .h file
    #import <UIKit/UIKit.h>
    #import "PageOneViewController.h"
    @interface HomeViewController : UIViewController {
    NSString *mln;
    NSString *mls;
    @property (readwrite, retain) NSString *mln;
    @property (readwrite, retain) NSString *mls;
    -(void)selectedmln:(NSString *)themln;
    @end
    important sections of the .m file
    #import "HomeViewController.h"
    #import "Constants.h"
    @implementation HomeViewController
    @synthesize mln, mls;
    -(void)selectedmln:(NSString *)themln {
    NSArray *mlnmls = [themln componentsSeparatedByString:@"+"];
    NSLog(@"Selected MLN: %@",[mlnmls objectAtIndex:0]);
    NSLog(@"Selected MLS: %@",[mlnmls objectAtIndex:1]);
    mln = [mlnmls objectAtIndex:0];
    mls = [mlnmls objectAtIndex:1];
    - (void)viewDidLoad {
    self.title = @"View";
    UIBarButtonItem *addButton = [[[UIBarButtonItem alloc]
    initWithTitle:NSLocalizedString(@"AddFavTitle", @"")
    style:UIBarButtonItemStyleBordered
    target:self
    action:@selector(addAction:)] autorelease];
    self.navigationItem.rightBarButtonItem = addButton;
    [super viewDidLoad];
    - (void)addAction:(id)sender
    NSLog(@"Steps: %@",@"entered add item");
    self.navigationItem.rightBarButtonItem.title = @"Added";
    NSLog(@"added: %@",mln); // mln is an 8 digit number but not cast as an int
    selectedmln() get passed something like "12345678+s" from the PageOneViewController everything works fine until it comes to the NSLog event in the addAction()
    silent crash with nothing helpful in the console.
    any Ideas?
    Jason

    Oops - I overlooked that. Then the solution is:
    self.mln = whatever
    instead of what I said the first time. Using 'self' accesses the generated property. Just calling 'mln' like you were sets the instance variable directly bypassing the property method and is auto generated retain.
    And yes, as pointed out, you must still release it yourself in dealloc.

  • Really simple button click problem...?

    I've made buttons a trillion times, but this button doesn't seem to be working...
    stop();
    addEventListener.btn_page2(MouseEvent.CLICK, gotoPage2);
    function gotoPage2(e:MouseEvent):Void {
         gotoAndPlay(99);
    I've checked that the button is labeled correctly (it is).... here are the compiler errors:
    Line 3 '{' expected
    Line 5 Unexpected '}' encountered
    What?!  Any ideas?

    You couldn't have made trillions of buttons that work using that code in AS3.  It would have to be something more like the following to work in AS3...
    stop();
    btn_page2.addEventListener(MouseEvent.CLICK, gotoPage2);
    function gotoPage2(e:MouseEvent):void {
         gotoAndPlay(99);
    Switched places in the btn_page2 line and changed Void (AS2) to void (AS3)

  • Very Urgent! Print Report output to local printer on button click in form

    In Sales Order Form there is a print receipt button. In current situation On Clicking the 'Print Receipt Button' it submits a XML Publisher report(PDF output) to the concurrent manager. Currently to print that report i need to go view--> requests--> view output and then print. According to my new Requirement i need to print that report directly to local printer on one simple Print receipt button click in form.
    I am trying to call the printers on server using custom.pll. The report is running successfully but it is not printing output to the local printer. I need to print the report to the local printers based on responsibility. Local printers are available on apps server. Can anyone help me on this issue ASAP.
    Is it possible to print the document using custom.pll? Is there any other alternative to print the report on simple button click in form.
    Environment: Apps 11.5.10.2, Forms 6i
    Here is the code that i am using in my custom.pll.
    if (v_form_name = 'OEXOETEL' --and v_block_name = 'LINES_SUMMARY'
         and name_in('parameter.ACTIONS') = 'PAYMENT_RECEIPT' )THEN
    l_organization_id := Name_In('PARAMETER.OE_ORGANIZATION_ID');
    l_order_header_id := Name_In('ORDER.header_id');
    select to_number(oe_sys_parameters.value ('SET_OF_BOOKS_ID')) into l_sob_id from dual;
    xml_layout := FND_REQUEST.ADD_LAYOUT('XXAFP','XXAFPOEXPMTRCRTF','en','US','PDF');
    select a.profile_option_value
    into v_printer_name     
    from fnd_profile_option_values a
    , fnd_profile_options b
    , fnd_profile_options_tl c
    , fnd_user fu
    where a.profile_option_id = b.profile_option_id
    and c.profile_option_name = b.profile_option_name
    and fu.user_id (+) = a.level_value
    and c.language = 'US'
    and c.user_profile_option_name='Printer'
    and a.level_id = 10003 ;
    if (FND_SUBMIT.SET_PRINT_OPTIONS(v_printer_name, 'Portrait', 2, TRUE, 'N'))
         then
    l_new_request_id := FND_REQUEST.SUBMIT_REQUEST('XXAFP','XXAFPOEXPMTRC',
    null,null,FALSE,l_sob_id,l_organization_id,NULL,NULL,l_order_header_id,
    chr(0), '', '', '', '', '', '', '', '', '', '',
    end if;
    fnd_message.set_string('Request Submitted for Custom Payment Receipt. Request ID is '||l_new_request_id);
    fnd_message.show;
    copy('NULL','parameter.ACTIONS');
    IF (l_new_request_id = 0) THEN
    FND_MESSAGE.RETRIEVE;
    FND_MESSAGE.ERROR;
    else
    l_commit_result := APP_FORM.QuietCommit;
    END IF;
    I need to complete this requirement immediately. Can anyone suggest me better ways in doing this.
    Thanks,
    Srinivas

    I solved this problem myself using shell script through custom.pll. I wrote shellscript and called that shellscript through FND_REQUEST.SUBMIT_REQUEST.It printed 2 copies to local printer.

  • Adding Image to Simple Button Dynamically Using AS3

    Hi,
    I need some help trying to figure out how to dynamically add an image (PNG or JPEG) that I can place in the library to a simple button also dynamically created in AS3.
    Is there a way to (1) add the image instead of using a text label and have it centered in the button?
    Here's the AS3 for the simple button without the image (currently uses text label but would prefer if possible to substitute an image for the text:
            var mc2:MovieClip = new MovieClip();
            mc2.addChild( bgRed2 );
            mc2.addChild( txt2 );//currently uses text label; would prefer to use an image istead of text
            var mc2a:MovieClip = new MovieClip();
            mc2a.addChild( bgRed2a );
            mc2a.addChild( txt2a );currently uses text label; would prefer to use an image istead of text
            var clearBtn:SimpleButton = new SimpleButton();
            clearBtn.upState = mc2;
            clearBtn.overState = mc2a;
            clearBtn.downState = clearBtn.upState;
            clearBtn.hitTestState = clearBtn.upState;
            clearBtn.x = 0;
            clearBtn.y = 0;
            addChild( clearBtn );
            clearBtn.x = 55;
            clearBtn.y = stage.stageHeight-clearBtn.height;
    Any help appreciated.

    assign your image a class name (eg, Img1). you can then use:
    var img1D:BitmapData=new BitmapData();
    var img1:Bitmap=new Bitmap(img1D);
    cleanBtn.upState=img1; // for example, button's upstate is the image.
    // if you wanted some background and the image centered on the background, create your background (sprite or movieclip), use addChild to add img1 to your background and center it.  then assign your button's upState etc to be your background

  • Hello, I have a question regarding the sharing/exporting on imovie. Whenever I click the share button all the normal options pop up, but when I actually click where I want to share it to nothing happens.  If you know what's wrong please let me know.

    Hello,  I have a question regarding the sharing on iMovie.  I have just recently purchased an Elgato Gaming Capture HD and I then finished my recording with that and put it into imovie.  I worked long and hard on the project and when I go click the share feature on iMovie all the noral options pop up and when I actually click where I want to share it to nothing at all happens.  If you know what is wrong/ what I am doing wrong please let me know.
    Thank you.
    PS:  I am using iMovie 10.0.6.

    /*line 957 error */
         public void select()
              for (count = 0; count <= p; count ++ )
                   if(P[count] != null){ /* validation */
                   m = (int)(P[count].getX());
                   n = (int)(P[count].getY());
                   if (Math.pow(-1, m + n) == 1)
                        piece[m][n].setBackground(wselect);
                   else
                        piece[m][n].setBackground(bselect);
              step = 2;
         }

  • Just installed Mac OS X 10.8.5  on a Mac Pro 2010 platform.    The App Store shows there is an upgrade, so I click the download button.   After about 2 hrs the process stops and an  Error (102) appears on the screen.  Any idea what goes wrong?  THX

    Just installed Mac OS X 10.8.5  on a Mac Pro 2010 platform. 
    The App Store shows there is an upgrade, so I click the download button. 
    After about 2 hrs the process stops and an  Error (102) appears on the screen. 
    Any idea what goes wrong? 
    THX

    ahstephen wrote:
    Thank you for the response.
    The upgrade I'm interested is for OS X  v.10.8.5...
    ...The App Store page shows 2 different upgrades:   
    Mountain Lion  (10.8.5)  Software Upgrade,  and
    Yosemite FREE upgrade
    If the App Store is showing 10.8.5 as an update, what do you currently have installed? The final update to Mountain Lion was 10.8.5, and since the basic OS installation of Mountain Lion is no longer offered in the App Store, that would suggest you're currently at an earlier version of Mountain Lion - 10.8.x where x=less than 5. If that's the case, I'd suggest getting the 10.8.5 update. There is also a Supplemental Update for 10.8.5 and that may be what the App Store is offering.

  • TS1367 I upgraded my cpu but when i start my mac pro it won't power on. I put back the original cpu, but still, it won't power on? What is wrong?

    M y mac pro won't power on. I upgraded my cpu, try putting bac k the original cpu but still it won't power on, what is wrong with my mac pro?
    Shear

    Reinstall Lion, Mountain Lion, or Mavericks without erasing drive
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Reinstall Mountain Lion or Mavericks
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • What's wrong with my ipad2? I just can't bear it always restart again and again when I just play a simple game!

    What's wrong with my ipad2? I just can't bear it always restart again and again when I just play a simple game! What's wrong with the apple without Jobs?!

    Try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.

  • IPod is using voice over and won't scroll. What setting did my child click? It will allow me to use voice control, but i need to know what's wrong first so I can give the correct command.

    My daughter's iPod is using voice over and won't scroll. What setting did my child click? It will allow me to use voice control, but i need to know what's wrong first so I can give the correct command.

    VoiceOver is an Accessibility feature while Voice Control allows you to control the Music app via voice.
    To turn off VoiceOver triple click the Home button and go to Settings>General>Accessibility and turn it off. Use three fingers to scroll if necessary.
    iPhone: Configuring accessibility features (including VoiceOver and Zoom)
    iOS: Getting started with VoiceOver for accessibility

  • Have new iMac with iPhoto sharing turned on. When the shared library is clicked the library disappears or starts to load then disappears? What is wrong?

    Have new iMac with iPhoto sharing turned on. When the shared library is clicked the library disappears or starts to load then disappears? What is wrong?

    Try this:  launch iPhoto with the Option key held down and create a new, test library.  Import some photos and check to see if the same problem persists. If it doesn't then your current library is damaged and needs repair.
    Therefore  make a temporary, backup copy (select the library and type Command+D) and  apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start with Option #1, followed by #3 and then #4 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    If you experience the same problem with the test library then try this basic fix a try:  make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    If that fails a reinstall of iPhoto is indicated. To do so you'll have to delete the current application and all files with "iPhoto" in the file name with either a .PKG or .BOM extension that reside in the HD/Library/Receipts folder and from the /var/db/receipts/  folder,
    Click to view full size
    Then install iPhoto from the source it came on originally.
    OT

  • After I click on sleep, my iMac wakes up immediately after, what's wrong?

    I want to make my iMac sleep, I click on SLEEP, it goes in sleep mode for a second and wakes up immediately. I don't touch my mouse nor the keyboard… What's wrong?

    Open System Preferences > Energy Saver
    Click:  Restore Defaults
    Then put your Mac to sleep.

  • I put  video clips together and added music off of iTunes but it will not attach when I put it on youtube or vimeo. what is wrong.  It plays as I made it on iMovie

    I put  video clips together and added music off of iTunes
    but it will not attach when I put it on youtube or vimeo.
    what is wrong.  It plays as I made it on iMovie

    Thank you all for your replies. Here is what i ended up doing. I cannot afford any 3rd party software so i went to itunes and manually entered all my playlists. As I had indicated my purchased music was on my new computer just not the playlists  and I could not sync my ipod. After I rebuilt all my playlists I tried to restore my ipod to factory defaults/new. All of the steps called for in apple support and elsewhere were not available to me. I connected my ipod, went to my computer, right clicked my ipod, and formatted. That wiped my ipod so when I connected to itunes it then gave me a restore option. I did the restore and all is good in the empire again. I can now buy new music and sync my ipod so I am a happy camper.
    Thanks to all.

  • I did`t saw any content of the menu button, what is wrong with my system Indesign

    I did`t saw any content of the menu button, what is wrong with my system Indesign

    more information will help.
    Try to select a frame and on the bottom of Buttons and Forms dailog box click on Covert to Button

  • My buttons and screen work, but I can't activate the screen to see what I'm doing.  Any idea what is wrong?

    My buttons and screen work, but I can't activate the screen to see what I'm doing.  This is after water damage.  Any idea what is wrong?  I'm not sure what to fix..
    I know the screen works because when it first turned on I saw the apple logo and then the screen.  If I hold the home and power button, I see the apple logo when it resets.  Then it goes blank again.
    I can hear when I get a call and pick up, and I can stop the sound and/or decline the call with the power button and side buttons.  It also still vibrates.  I'm confused - if the screen works, the buttons work, it vibrates, makes sound, and the touchscreen feature also works...  what is wrong for me to fix?  Why can't I see anything?!
    I appreciate any help anybody has to offer!!!

    I apologize for the confusion.  This was literally the only option on Apple's "Contact Us" section that I was able to access.  I assumed that Apple's clear intent to have me go here instead of speaking with someone in live time, and the fact this is on the Apple website, meant I could get some advice...  Both over the phone and online they require information I need to see my screen to provide so those are not options.  I tried to bypass this when calling through Skype.  Some lady who didn't know what was going on, who I waited a good while to speak with, put me on hold; I gave up after 30minutes of waiting to speak to somebody again.
    I've stumbled upon a few tricks to help me get through this problem, but I'm at a loss.  I need this phone to work until late December.  I need more tricks.  So yes, it's worth understanding.  Knowing what is going on will let me Google it and work with it, if nobody here is willing to help...
    And yes, it IS a glitchy phone.  It has been a glitchy phone for a long time.  Long before this. But completely unrelated issues.  I was assuming this wasn't just a glitch but something maybe somebody could help me understand.

Maybe you are looking for

  • Windows 7 and Arch linux dual boot problem

    hey guys I had an issue with windows 7 dual booted with arch and i was just wondering my windows 7 crashed. I had Reinstalled windows OS and all my partitions are set up but now when I try to boot up arch I cant at all cause windows Boot took over an

  • External Hard Drive became read-only [SOLVED]

    I have a seagate external hard drive formated to ntfs. I have been using it successfully with arch until recently. Now when I try to add files to it it refuses. I tried changing the permission back with sudo chmod ugo+rwx -R /media/FreeAgent\ Drive B

  • RMI method invocation leading to Memory Leak

    My application uses RMI for communicating between two java processes. I'm observing some kind of memory leak in one of the classes in RMI library. When observed through OptimizeIT, I see a large number of Object[] being created by the ClassDefiner.de

  • I wish to rename my drive letter & not create problems

    I had an SSD installed on my PC.  The SSD is 'C' & kept for programs only. The other drive  letters I have currently got displayed don't make much sense.I started with CD burner & Blu-ray burner & got them away from my own files by changing the drive

  • When I try to transform an object my screen goes blank, how can I correct this?

    When I try to transform an object my screen goes blank, how can I correct this?