开发者

Removing UITextField from superview does not make it disappear on screen

I have the following code

// Breakpoint here
[label removeFromSuperview];
[label release];
label = nil;

stepping through it with the debugger outputs

(gdb) po [self subviews]
<NSCFArray 0x476af70>(
<UIImageView: 0x47581a0; frame = (0 0; 232 81); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x476b3d0>>,
<UILabel: 0x4758870; frame = (15 11; 202 56); text = 'Test'; clipsToBounds = YES; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x476b590>>
)

(gdb) po label
<UILabel: 0x4758870; frame = (15 11; 202 56); text = 'Test'; clipsToBounds = YES; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x476b590>>
(gdb) n
(gdb) n
(gdb) n
(gdb) po [self subviews]
<NSCFArray 0x478c4e0>(
<UIImageView: 0x47581a0; f开发者_高级运维rame = (0 0; 232 81); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x476b3d0>>
)

Yet it is still visible, it does not disappear. Not even if I do [self setNeedsDisplay] immediately after.

Has anyone else come across this? Is it a bug in the SDK or am I missing something?


It turns out a bug in my code elsewhere was causing multiple identical views to be created on top of each other, leading to this behaviour.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜