views:

69

answers:

2

Hi,

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 do something with autorelease?

Ton.

A: 

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.

Rudiger
A: 

I can't login anymore, so i have to post an anwser myself. i will have try with your answer. And hopr i can release the controller and the functions of the view will keep on working.

Thank you verry much.

Tony