how to set data into textfeild
- by shishir.bobby
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