views:

28

answers:

1

Hi,

I am working on a iPone application it allows users to edit the data shown in the table view. In this task I use custom UITableViewCell which consist of UILable and UITextField. After editing finish how can I read the values in UITextField of all rows ?

A: 

you have to store the data in dictionary or an object in the delegate method didendediting of textfield

Hope the below sample code helps you

- (void)textFieldDidEndEditing:(UITextField *)textField
{
    switch (textField.tag) {
        case 0:
            objAboutYouClass.name=textField.text;           
            break;
        case 1:
            objAboutYouClass.email=textField.text;          
            break;
        case 2:
            objAboutYouClass.workRole=textField.text;           
            break;
        case 3:
            objAboutYouClass.area=textField.text;           
            break;
        case 4:
            objAboutYouClass.managersName=textField.text;           
            break;
        case 5:
            objAboutYouClass.securityQuestion=textField.text;           
            break;
        case 6:
            objAboutYouClass.answer=textField.text;         
            break;

        default:            
            break;
    }
}

This is the best approach i suppes. I have used class you can also use dictionary to store the content.

hAPPY cODING.....

Suriya
Also as told by krishnan. Atleast accept the answers if they have helped you. your accept rate is 0% and dats the reason why noone has yet answered your simple question.Thanks,Suriya
Suriya