Redian新闻
>
QMC妹妹,我能跟你炒一下价吗
avatar
z*a
2
青青子吟已经炒上去了,我们什么时候吵吵架?
avatar
S*r
3
I suggest you
1. move backgroundImageView.hidden = !selected;
to within
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
because it's not a good idea to manipulate UI in a data member's setter.
2. let system generate setter and getter for you.
avatar
c*g
4
I moved the backgroundImageView.hidden = !selected to the touchesBegan: call
. However, now the leaks
instrument reports the touchesBegan is leaking. According to the report, the
leaking statement is
"backgroundImageView.hidden = !selected". That's why I am confused.
I also posted this to Apple's developer forum. One guy mentioned if an
object leaks, all its sub-objects will
leak as well. But I just couldn't find out the root cause.
Thanks anyway.

【在 S**********r 的大作中提到】
: I suggest you
: 1. move backgroundImageView.hidden = !selected;
: to within
: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
: because it's not a good idea to manipulate UI in a data member's setter.
: 2. let system generate setter and getter for you.

avatar
i*o
5
What happens when background image is shown or hidden, maybe once it is
shown, some view will have a reference to it, and that guy is not releasing
it.
So basically follow the chain reaction caused by this call...

【在 c********g 的大作中提到】
: 最近一个memory leak的问题搞得我头大,有人愿意看看吗?给出有效线索或解决方案
: 的发大包子。
: http://stackoverflow.com/questions/6302545/crazy-leak-detection

avatar
c*r
6
你的 image 是怎样 init 的 ? 是用
imageWithXXX 这类 helper 还是老老实实的 init?
avatar
S*y
7
re
avatar
r*r
8
找找可能相关的文件里的alloc,init,new和retain调用,对每一个仔细
验证一下它是怎么release的,也许有帮助。尤其是跟backgroundimageview
有关的那些

【在 S********y 的大作中提到】
: re
avatar
c*g
9
all my images are initialized by "imageNamed"

【在 c*********r 的大作中提到】
: 你的 image 是怎样 init 的 ? 是用
: imageWithXXX 这类 helper 还是老老实实的 init?

avatar
c*r
10
imageNamed 这种 helper 通常都用 autorelease pool, 不需要你专门去 release.
你换个 initWithContentsOfFile 试试, 别忘了要 explicitly release. 管用的话别
忘了给我包子.
avatar
j*d
11
有memory leak先怀疑所用的lib, 再怀疑compiler,再怀疑OS,再坏疑firmware,再怀疑
hardware
还不行,那只能怀疑上帝了(如果你信的话)

【在 c********g 的大作中提到】
: 最近一个memory leak的问题搞得我头大,有人愿意看看吗?给出有效线索或解决方案
: 的发大包子。
: http://stackoverflow.com/questions/6302545/crazy-leak-detection

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。