Advertisement
Guest User

Untitled

a guest
May 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. + (UITableViewCell*) newEntryValueCell:(UITableView * )tableView {
  2.     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"entrytablecell"];
  3.     if (cell == nil) {
  4.         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
  5.                                        reuseIdentifier:@"entrytablecell"] autorelease];
  6.         cell.accessoryType = UITableViewCellAccessoryNone;
  7.         cell.selectionStyle = UITableViewCellSelectionStyleNone;
  8.        
  9.         UITextField *playerTextField = [[UITextField alloc] initWithFrame:CGRectMake(120, 12, 175, 30)];
  10.         playerTextField.adjustsFontSizeToFitWidth = YES;
  11.         playerTextField.textColor = [UIColor blackColor];
  12.         playerTextField.keyboardType = UIKeyboardTypeASCIICapable;
  13.         playerTextField.returnKeyType = UIReturnKeyDone;
  14.         playerTextField.delegate = self;
  15.         playerTextField.backgroundColor = [UIColor clearColor];
  16.         playerTextField.autocorrectionType = UITextAutocorrectionTypeNo; // no auto correction support
  17.         playerTextField.autocapitalizationType = UITextAutocapitalizationTypeNone; // no auto capitalization support
  18.         playerTextField.textAlignment = UITextAlignmentLeft;
  19.         playerTextField.keyboardAppearance = UIKeyboardAppearanceAlert;
  20.         playerTextField.tag = ENTRY_TEXT_FIELD_TAG;
  21.        
  22.         playerTextField.clearButtonMode = UITextFieldViewModeNever; // no clear 'x' button to the right
  23.         [playerTextField setEnabled: YES];
  24.         [cell addSubview:playerTextField];
  25.         [playerTextField release];
  26.     }
  27.     return cell;
  28. }
  29.  
  30. on return cell:
  31.  Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement