iOS designer events

GaganSinghGaganSingh USUniversity ✭✭✭

Hi, I was wondering how I can create events for components in the iOS designer.
I tried to create a value changed event for a textfield by:
1. created textfield
2. went into events tab of the component and typed text_ValueChanged
3. created a text_ValueChanged method with the following parameters

public void text_ValueChanged (object s, EventArgs e)

what am I doing wrong?

Posts

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    For a text field, I believe you should be using the EditingChanged event, not the ValueChanged event.

  • GaganSinghGaganSingh USUniversity ✭✭✭

    thanks a lot!
    Also I had to change the method signature to:

    partial void text_Changed (UITextField sender)
    {
    }

    So for anyone else having trouble with this,
    I named the text field "text"
    And in the iOSViewController.designer.cs file that auto-generates code,
    the outlet and action are:

    [Outlet]
    MonoTouch.UIKit.UITextField text { get; set; }

    [Action ("text_Changed:")]
    partial void text_Changed (MonoTouch.UIKit.UITextField sender);

Sign In or Register to comment.