@interface Aztpasswordmodifyviewcontroller () <uitableviewdelegate, Uitableviewdatasource>{
nsstring *_theoldpassword;
nsstring *_thenewpassword;
nsstring *_thetwicenewpassword;
}
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (nsindexpath*) Indexpath
{
Nsinteger row = [Indexpath row];
static NSString *cellidentifier = @ "Cellidentifier";
UITableViewCell *cell = [TableView dequeuereusablecellwithidentifier:cellidentifier];
if (cell = = nil) {
cell = [[[UITableViewCell alloc] Initwithstyle:uitableviewcellstyledefault Reuseidentifier:cellidentifier] Autorelease];
Cell.selectionstyle = Uitableviewcellselectionstylenone;
}
Cell.textLabel.text = [_passwordarray objectatindex:row];
CGRect textfieldrect = CGRectMake (0.0, 0.0f, 215.0f, 31.0f);
Uitextfield *thetextfield = [[Uitextfield alloc] initwithframe:textfieldrect];
Thetextfield.contentverticalalignment = Uicontrolcontentverticalalignmentcenter;
Thetextfield.returnkeytype = Uireturnkeydone;
Thetextfield.securetextentry = YES;
Thetextfield.clearbuttonmode = YES;
Thetextfield.tag = row;
Thetextfield.delegate = self;
This method is the key method
[Thetextfield addtarget:self Action: @selector (Textfieldwithtext:) forcontrolevents:uicontroleventeditingchanged];
Switch (ROW) {
Case 0:
Thetextfield.placeholder = @ "Please enter the old password";
Break
Case 1:
Thetextfield.placeholder = @ "Please enter a new password";
Break
Case 2:
Thetextfield.placeholder = @ "Please enter the new password again";
Break
Default
Break
}
Cell.accessoryview = Thetextfield;
[Thetextfield release];
return cell;
}
-(void) Textfieldwithtext: (Uitextfield *) TextField
{
Switch (Textfield.tag) {
Case 0:
Self.theoldpassword = Textfield.text;
Break
Case 1:
Self.thenewpassword = Textfield.text;
Break
Case 2:
Self.thetwicenewpassword = Textfield.text;
Break
Default
Break
}
}
Get UITableView of different uitextfield inputs in each row (for example, to change the login password)