views:

11

answers:

1

I am adding a no. of UILable dynamically to my view like this

UILabel *test = [[UILabel alloc] initWithFrame:CGRectMake(x, y, 50, 50)];  
[self.view addSubview:tick];

Is it necessary to release these UILabel from memory in viewDidUnLoad and dealloc, if yes how i will release them? how i will get their reference?

+1  A: 

Yes.

Since self.view already -retained the label in -addSubview:, you can -release it immediately.

UILabel *test = [[UILabel alloc] initWithFrame:CGRectMake(x, y, 50, 50)];  
[self.view addSubview:test];
[test release]; // <--
KennyTM