Page 1 of 1

iPhone - help removing a UITextField?

PostPosted: Jul 30, 2009 @ 11:00pm
by EarthWind
I've got a UITextField up and running overtop of my EdgeLib powered game. Everything works fine, I've created delegate class to handle the enter key and auto close the keyboard, the text is passed back to my app no problem.

The thing I am having troubles with though is actually removing the UITextField from the screen once I'm done with it! How silly is that.

I've tried many things and I can't get it to not display itself anymore.

[inp removeFromSuperview] does nothing even though I've added it as a using [window addSubview:inp].

I've also fooled around with the retainCount/release stuff to make sure it is no longer being retained, plus various other things.

Any ideas?

PostPosted: Aug 3, 2009 @ 10:25am
by edge
Hi EarthWind,

The problem should be fixed in release 3.97. Could you try it and let us know if it works?

PostPosted: Aug 4, 2009 @ 5:08pm
by EarthWind
Actually I got it to work without downloading the new version.

I was able to remove the input text field by calling removeFromSuperview from the textFieldShouldReturn method.

I believe when I was calling it from other locations I wasn't calling it from the same thread that created the textfield. I had read somewhere on this forum that possibly that was an issue and addition/removal should be done on the same thread.