开发者

iphone basic release question

When i add a new subview, i cant immediately release the controller after displaying. How should i release this viewController?

I was thinking about using a property for the viewController, and use delegation to notify for removing the view and releasing it?

Is this the best way to do it? or should i d开发者_开发百科o something with autorelease?

Ton.


I'm going to have a shot at answering this rather vague question. I think what you are doing is creating a new subview and then releasing it. What you need to do is add it to your main view. Something like:

[myView addSubview.newSubview];

Once you have done this myView owns the subview and you can release it without hassles.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜