Created
August 19, 2010 05:09
-
-
Save jacobch/537101 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
UILabel *label; | |
UITextField *textField; | |
if (cell == nil) { | |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; | |
cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
label = [[UILabel alloc] initWithFrame:CGRectMake(10, 12, 90, 25)]; | |
label.font = [UIFont boldSystemFontOfSize: 16]; | |
label.tag = 1; | |
[cell.contentView addSubview:label]; | |
textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 12, 200, 25)]; | |
textField.tag = 2; | |
textField.delegate = self; | |
[cell.contentView addSubview:textField]; | |
} | |
else { | |
label = (UILabel *)[cell.contentView viewWithTag:1]; | |
textField = (UITextField *)[cell.contentView viewWithTag:2]; | |
} | |
switch (indexPath.row) { | |
case 0: | |
label.text = @"Domain"; | |
// [textField becomeFirstResponder]; | |
break; | |
case 1: | |
label.text = @"Email"; | |
break; | |
case 2: | |
label.text = @"Password"; | |
textField.secureTextEntry = YES; | |
break; | |
} | |
[label release]; | |
[textField release]; | |
return cell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment