tags:

views:

82

answers:

1

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:

@synthesize sometext;

- (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?.
+1  A: 

You don't. Is it a leak? If you are just looking at the Allocations, don't expect it to go back down.

EDIT:

Clarification - Object Allocations in Instruments will always go up. It won't go down. It doesn't show deallocations, just allocations...

marcc
Thanks for your reply. I'm looking at the memory allocations. Basically the memory consumed by displaying the Keyboard will remain there until the application quits then? That's too bad, it's a whooping impact after some time.Thanks.
Joshep Freeman
edited my answer.
marcc
Oh wow, thanks I was testing some profile yesterday on an app, and there were no leaks, but a lot of allocs...
Rigo Vides