displaying keyboard raises memory... but it never comes down iPhone

Posted by Joshep Freeman on Stack Overflow See other posts from Stack Overflow or by Joshep Freeman
Published on 2010-03-25T22:08:21Z Indexed on 2010/03/25 22:13 UTC
Read the original article Hit count: 401

Filed under:

Hello again.

I encountered a weird behavior in memory just by displaying the default keyboard. I've just created a project with an .xib file for testing purposes. This .xib file has an UITextField element in it and it's connected in the .h via:

@property(nonatomic, retain) IBOutlet UITextField *sometext;

The .m has no changes but:

- (void)viewDidAppear:(BOOL)animated {
 [someText becomeFirstResponder];
}

As you see it's very very simple. The problem is that once the keyboard is shown, the memory allocated for it NEVER goes down. I've tested this scenario in another project with the only difference of having two .xib files. Standar pushViewController and popViewController calls are made. Instruments show an increase of 600kb in memory allocations [which are a lot more in the actual iPhone device].

All in all, hehehe. My question is:

  • How do I release the memory allocated for the keyboard?.

© Stack Overflow or respective owner

Related posts about memory