Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory increases drastically when I type in a UITextfield
    primarykey
    data
    text
    <p>This is how I have created two textfields in a tableview and i release them in the dealloc method.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"MyIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease]; } cell.accessoryType = UITableViewCellAccessoryNone; if ([indexPath row] == 0) { text = [[UITextField alloc] initWithFrame:CGRectMake(5, 5, 300, 30)]; text.delegate=self; text.userInteractionEnabled=NO; text.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter; if ( qNum-1 == 53 ) { text.placeholder=@"Category"; } [cell.contentView addSubview:text]; } if ([indexPath row] == 1) { text2 = [[UITextField alloc] initWithFrame:CGRectMake(5, 5, 300, 30)]; text2.delegate=self; text2.userInteractionEnabled=NO; if(qNum-1==53) { text2.placeholder=@"Subcategory"; } text2.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter; [cell.contentView addSubview:text2]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } </code></pre> <p>The problem is as soon as the virtual keyboard appears and i start typing into the textfields the memory increases drastically. Can someone please help me out of this problem ? Thanks in advance.</p> <p>Here is the code I have written inside the delegate methods</p> <pre><code>- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return YES; </code></pre> <p>}</p> <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField{ if([text.text isEqualToString:@"United States"]||[text.text isEqualToString:@"Australia"]){ text2.userInteractionEnabled=NO; item.title=@"State"; myPickerView.hidden=YES; myPickerView2.hidden=NO; [actionSheet showInView:mainView]; [actionSheet setBounds:CGRectMake(0, 0, 320, 400)]; } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload