project_files/HedgewarsMobile/Classes/EditableCellView.m
changeset 3667 9359a70df013
parent 3662 a44406f4369b
child 3697 d5b30d6373fc
equal deleted inserted replaced
3665:bc06dd09cb21 3667:9359a70df013
    25         textField.returnKeyType = UIReturnKeyDone;
    25         textField.returnKeyType = UIReturnKeyDone;
    26         textField.adjustsFontSizeToFitWidth = YES;
    26         textField.adjustsFontSizeToFitWidth = YES;
    27         [textField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
    27         [textField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
    28         
    28         
    29         [self.contentView addSubview:textField];
    29         [self.contentView addSubview:textField];
    30         [textField release];
    30         //[textField release];
    31         
    31         
    32         titleLabel = [[UILabel alloc] init];
    32         titleLabel = [[UILabel alloc] init];
    33         titleLabel.textAlignment = UITextAlignmentLeft;
    33         titleLabel.textAlignment = UITextAlignmentLeft;
    34         titleLabel.backgroundColor = [UIColor clearColor];
    34         titleLabel.backgroundColor = [UIColor clearColor];
    35         titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
    35         titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
    36         [self.contentView addSubview:titleLabel];
    36         [self.contentView addSubview:titleLabel];
    37         [titleLabel release];
    37         //[titleLabel release];
    38         
    38         
    39         minimumCharacters = 1;
    39         minimumCharacters = 1;
    40         maximumCharacters = 64;
    40         maximumCharacters = 64;
    41         oldValue = nil;
    41         oldValue = nil;
    42     }
    42     }
    69     [super setSelected:selected animated:animated];
    69     [super setSelected:selected animated:animated];
    70     // Configure the view for the selected state
    70     // Configure the view for the selected state
    71 }
    71 }
    72 
    72 
    73 -(void) dealloc {
    73 -(void) dealloc {
    74     [oldValue release], oldValue = nil;
    74     self.delegate = nil;
    75     [titleLabel release], titleLabel = nil;
    75     releaseAndNil(oldValue);
    76     [textField release], textField = nil;
    76     releaseAndNil(titleLabel);
       
    77     releaseAndNil(textField);
    77     [super dealloc];
    78     [super dealloc];
    78 }
    79 }
    79 
    80 
    80 #pragma mark -
    81 #pragma mark -
    81 #pragma mark textField delegate
    82 #pragma mark textField delegate