how to set data into textfeild

Posted by shishir.bobby on Stack Overflow See other posts from Stack Overflow or by shishir.bobby
Published on 2010-06-16T05:18:10Z Indexed on 2010/06/16 5:22 UTC
Read the original article Hit count: 420

Filed under:

hi all

i have a table view containing some text. and an selecting a row, i hv to set text on another view's textfeild based on the selected index of row od table view.

this is hoe it looks like

-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
    abc *abcController = [ [ abcController alloc] initWithNibName:@"abcController" bundle:[NSBundle mainBundle]];
    [self.navigationController abcController animated:YES];

    coffeeObj = [appdelegate.coffeeArray objectAtIndex:indexPath.row];



abcController.sender.text =[NSString stringWithFormat:@" to %@", coffeeObj.to];
abcController.mobileNumber.text = [NSString stringWithFormat:@" from %@", coffeeObj.from];  [abcController release];

}

and this is how my textfeilds looks like, which is in table view

if(indexPath.row == 0)
        textField.keyboardType = UIKeyboardTypeDefault;
    else
        textField.keyboardType = UIKeyboardTypePhonePad;
    textField.autocorrectionType = UITextAutocorrectionTypeNo;

    [cell.contentView addSubview:textField];

    if(indexPath.row == 0)
    {
        self.sender = textField;
        cell.textLabel.text = NSLocalizedString(@"From :", @" ");
        NSLog(@"sender:  %@", self.sender.text);
    }
    else 
    {
        self.mobileNumber = textField; 
        cell.textLabel.text = NSLocalizedString(@"To :" ,@" ");
        NSLog(@"mobile Number:  %@", self.mobileNumber.text);
    }
    [textField release];

my problem is i am not abel to set text in these textfeilds from previous view.....

plz let me knw where i am wrong.....

w8ing for a quick reply.. regards shishir

© Stack Overflow or respective owner

Related posts about iphone