i create views in viewDidLoad,such as
UIScrollView* scrollViewright = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,400,768)];
[scrollViewright setContentSize:CGSizeMake(400,1000)];
[self.view addSubview:scrollViewright];
so,how can i release them?
i use [scrollViewright release]; in ‘- (void)dealloc’ and self.scrollViewright = nil in ‘-(void)viewDidUnload’,both of them tell me wrong ,so can anybody help me?
Well you have two kinds of release that can be done:
And the next one, when you want to remove the scrollView from the main view: