How can I get text from a text field and display it in an alert?

Hello!  I am BRAND NEW to Objective-C and Xcode and iOS, so PLEASE be forgiving of what is going to be a stupid question.  I have a text field.  I want to enter some text, click "return", and see my text in an alert.  It doesn't serve any useful purpose, but this is how I learn.  So far, I am unsuccessful.  Here's my function from my HelloEarthViewController.m file:
-(IBAction)showInputMessageUITextField *)textField
if ([textField.text isEqualToString:@""])
    return;
UIAlertView *helloEarthInputAlert = [[UIAlertView alloc]
                                     initWithTitle:@"Name!" message:[NSString stringWithFormat:@"Message: %@", textField.text]
                                     delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
// Display this message.
[helloEarthInputAlert show];
Then I go option+click the text field and drag it to File's Owner and connect it to "showInputMessage:"  Then I run it and the build succeeds, but nothing happens when I click my "return" button on the iPhone simulator.
What have I missed?  Where have I gone wrong? 

Okay, here's where I am.  I have this in my view controller .h file:
@interface HelloEarthViewController : UIViewController <UITextFieldDelegate>
    IBOutlet UITextField *textFieldTest;
@end
And this in my view controller .m file:
-(IBAction)showInputMessage
    if ([textFieldTest.text isEqualToString:@""])
        return;
    UIAlertView *helloEarthInputAlert = [[UIAlertView alloc]
                                         initWithTitle:@"Name!" message:[NSString stringWithFormat:@"Message: %@", textFieldTest.text]
                                         delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    // Display this message.
    [helloEarthInputAlert show];
And I have connected the text field to showInputMessage.  When I hit "return", however, I still get nothing.
Is an "action button" a real button?  From my limited understanding, the alert should launch when I click "return" since showInputMessage is attached to Editing Did End on the text field.
Thanks for the help.  The transition from writing C# for web applications to writing Objective-C for iOS applications is not going as smoothly as I'd anticipated.

Similar Messages

  • How can I stop firefox from checking add-ons and displaying the What's new page each time I launch it

    Since upgrading to the latest version, I have viewed read and interacted with everything on the What's new page. I have done this a number of times but the page is still opened each time I launch Firefox. In addition it shows my homepage in a second tab.
    Prior to opening Firefox it checks for add-ons.

    hello Michells, this will likely be caused by the user.js file in your profile folder.
    go to the firefox ''menu ≡ > help ? > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js''' and restart the browser afterwards.
    [[How to fix preferences that won't save]]

  • I used my appleid on my husband's phone.  Our contacts merged and our phones both ring and he sees my texts. I deleted his contacts from my phone and they deleted from his phone also.  How can I get my appleid off his phone and restore his contacts?

    I used my appleid on my husband's phone.  Our contacts merged, both phones ring and he sees my texts.  I deleted his contacts from my phone and they deleted from his phone also. How can I get my appleid off his phone and retrieve his contacts?

    Teacher48 wrote:
    I used my appleid on my husband's phone.  Our contacts merged, both phones ring and he sees my texts.  I deleted his contacts from my phone and they deleted from his phone also. How can I get my appleid off his phone and retrieve his contacts?
    Bad mistake. You shouldn't have used your Apple ID on his phone. And you made it worse because now the contacts are gone, as you deleted them from your phone, they got deleted on iCloud. Your husband should have his Apple ID.
    There is really no way of recovering the deleted contacts unless you backed up using iTunes and even then you will only be able to recover those contacts that were on a call list. Read here:
    iTunes: About iOS backups

  • How can I get values from listbox?

    Hi all,
    I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
    How can I get values from Pricelist listbox?
    Thanks for any suggestions or short sample code.
    Best regards,
    Andy

    Hi Andy
    Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
      Public Sub GetItemPriceFromOpenWindow()
            'this is assuming item master is open
            Dim oEdit As SAPbouiCOM.EditText
            oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
            SBO_Application.MessageBox(oEdit.Value)
            Dim oCmb As SAPbouiCOM.ComboBox
            oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
            SBO_Application.MessageBox(oCmb.Selected.Description)
        End Sub
    Hope it helps

  • HT203167 lost my hard drive how can i get songs from ipod back to new computer

    I lost my hard drive and want to get my music back on my new computer. How can I get songs from my ipod to my computer? I am afraid to sync it and losing what is on my ipod. Any help would be appreciated.

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.
    Use your backup copy to put everything back.
    If for some reason you have failed to maintain a backup, not good, then you can transfer itunes purchases from your ipod:  File>Transfer Purchases

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

  • How can i get contacts from my old Nokia phone to iphone 4S

    how can i get contacts from my old Nokia phone to iphone 4S?

    Appreciate the reply thank you
    Issue being is I don't have the lead for the samsung any longer but have the memory card?
    An yes I know I need to get them onto my MAC but how is what i'm struggling with?
    Any help would be appreciated.
    Many thanks

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How can I get music from old mac to new mac?

    How can I get music from old mac to new mac please?
    Can't seem to make Migration Assistant work. Doesn't ask about or transfer files.

    I just migrated into a new MBP from an old one.
    It did not bring the music over.  Apple's instructions are to use the Home Sharing feature of iTunes.
    Open iTunes on your old Mac.  Select Home Sharing under the Advanced menu.  Sign in.  Do the same on your new computer.  Then when the library appears under Home Sharing on the left-hand panel on your new computer's iTunes, you can select all and Add To Library.
    That's what Apple says, anyway.

  • How can I get sound from tv or stereo when watching netflix on MacBook Air?

    I have my macbook air hooked up to my tv and want to watch netflix but the only sound is from my macbook.  How can I get sound from other sources ie tv or stereo?

    Check with Netflix for their system requirements.

  • How can i get data from a maintance view?

    Hi all.
        Can you give me some suggestion about 'How can i get data from a maintance view?'?
         Thanks
         Best regard

    hi
    good
    go through this link
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ecdf446011d189700000e8322d00/content.htm
    thanks
    mrutyun^

  • How can you get pics from your Camera roll to you photo stream

    How can you get pics from your Camera roll to you photo stream

    iCloud: Photo Stream FAQ
    iCloud: Photo Stream
    iCloud: Set up Photo Stream

  • How can i get input from user in Workflows

    Hello professionals,
    I'm new to SAP B1 Workflow, i have created some workflows and they all worked fine.
    But, I am wondering, How can i get input from user?. For example, i want to display list of options to choose between them and route the workflow based on the selected option. I don't want to use the exclusive gateway and check for some conditions, i want to get input from user.
    How can i do that?
    Thanks in advance,
    Kareem Naguib

    Hi,
    Please refer SAP help file:
    http://help.sap.com/saphelp_sbo900/helpdata/en/b8/1f9a1197214254b79bcf8f93f9fff9/content.htm?frameset=/en/44/c4c1cd7ca22…
    Thanks & Regards,
    Nagarajan

  • I purchased a song (Awaara Hoon (instrumental)) from itune store but it gives me a non-protected m4a file. I need a protected m4p file. How can i get it from itune store??? thanks in advance

    I purchased a song (Awaara Hoon (instrumental)) from itune store but it gives me a non-protected m4a file 
    I need a protected m4p file.
    How can i get it from itune store???
    thanks in advance

    All the music from iTunes Store aren't protected. You can search the web for a site that sells protected music.

  • HT5500 how can i get "via iOS" in my postings and comments from my iPhone?

    how can i get "via iOS" in my postings and comments on facebook from my iPhone?

    I have the same issue.  NO "via ios" ONLY "via mobile"
    iPhone 4 - IOS 6.0.1
    iPad 3rd Generation IOS 6.0.1
    FB App installed both devices from Settings//Facebook/Install App using IOS FB Integration with my username/password.
    Troubleshooting Done to this point -
    Uninstalled FB on iPhone and reinstalled again using the FB in Settings/Facebook/Install App. Entered my username/password in Settings/Facebook.
    Turned Wi-Fi off and posted using Cellular connection  (says via mobile).
    Turned Cellular off and posted connected to Wi-Fi  (says via mobile)
    Set iPad 3 back to factory default.
    Reinstalled everything fresh (did not use iCloud backup).
    Installed FB app from Settings/Facebook/Install App. and entered username/password in Settings/Facebook.
    Turned Wi-Fi off and posted using 4G cellular connection.  (says via mobile)
    Turned 4G Cellular off and posted via Wi-Fi  (says via mobile)
    ALL of my posts from both devices show as being "via mobile". This is extremely frustrating since everyone else in the world seems to post status/comments/pictures/etc from their iPhones and iPads and get the "via IOS" except me.
    At first I thought maybe it was an iPhone 4 issue, but the iPad 3 is the newest version of iPad and even it says "posted via mobile" instead of "ios". 

  • HT201302 Hi People! please help...I want to know how can i get photos from ipad to the computer, that were synchronized previously to ipad but from another pc that i dont have access anymore and these pics are now only found in this ipad and no other plac

    Hi People!
    Please help...I want to know how can i get photos from ipad to the computer, that were synchronized previously to ipad but from another pc that i dont have access anymore and these pics are now only found in this ipad and no other place.

    Hi Alan,
    Thanks for the help, but i've actually done that before.
    It does not help, because it only shows the photos on the camera roll and do not show the photos synchronized with that pc that i dont have access anymore.
    The photos/albums all appear on the ipad, i can see it without problems but i cant get them out of the ipad to save onto pc for backup.
    And i reaaly need it, as it is the only place that i actually have these photos now...

Maybe you are looking for

  • HT1338 Can I update my Mini 2 GHz Intel Core 2 Duo /4 GB 667 MHz DDR2?

    My Mini -- 2 GHz Intel Core 2 Duo /4 GB 667 MHz DDR2 -is "mid 2007".  What happens if I try to install Mtn Lion? Because there is a lot of buggy stuff about 10.7.x.  For instance, Wifi does not maintain a steady connection when using a non-airport wi

  • PPR Handling

    Hi, How can few columns rendered as read only based on the user selecting a specific column in a row ( oa advance table ) if If there are no PPR events enabled for the respective check box beans in the standard pages , is there any alternate way to d

  • Formulas in Numbers 3.0.1 files not converting to Excel

    When I save a Numbers file as Excel the formulas do not work in Excell, I have to export it as a iWork 09 file, open it in iWork 09 and save it as Excel. Seems crazy to release this to the public without the function working?

  • Weird Behavior

    I'm trying to use the contains access to make a query but JDO, here is my code : ( ignores the variables ) extent = pm.getExtent( Permission.class, false ); query = pm.newQuery( Permission.class, extent, "permissionGroupMap.contains(pgMap) & pgMap.us

  • Saving animation as a GIF thats compatible with serif webplus

    this is my first ever experiment with photoshop so apologies in advanced. basically i have created an animation on AE, of a welder welding with sparks playing. its also on a transparent background. I have managed to learn how to render the video to g