Created
December 17, 2008 04:29
-
-
Save boucher/36938 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
| // Add a text field to the cell | |
| cell = [tableView dequeueReusableCellWithIdentifier:@"usernameCell"]; | |
| if (!cell) | |
| { | |
| cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"usernameCell"] autorelease]; | |
| cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
| cell.text = @"username"; | |
| cell.font = [UIFont boldSystemFontOfSize:16.0]; | |
| UITextField *inputField = [[UITextField alloc] initWithFrame:CGRectMake(0, 10.0f, 180.0f, 25.0f)]; | |
| inputField.borderStyle = UITextBorderStyleNone; | |
| cell.accessoryView = inputField; | |
| [inputField release]; | |
| inputField.autoresizingMask = UIViewAutoresizingFlexibleWidth; | |
| cell.autoresizingMask = UIViewAutoresizingFlexibleWidth; | |
| } | |
| usernameField = cell.accessoryView; | |
| usernameField.placeholder = @"your username"; | |
| usernameField.delegate = self; | |
| usernameField.text = [defaults stringForKey:usernameKey]; | |
| return cell; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment