[[+content_image]]
D
D
dimib2014-10-08 18:15:36
iOS
dimib, 2014-10-08 18:15:36

How to remove object from View?

Good day.
This is how I create the object:

-(void)CreateObject {
CGRect SQ = CGRectMake (...);
UIImageView object = [[UIImageView alloc] initwithFrame:SQ];
[self.view addsubview: object];
}

How to remove it now? To erase it from memory, as if it never existed?
Thank you.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
Denis Morozov, 2014-10-08
@morozovdenis

-(void)CreateObject {
CGRect SQ = CGRectMake (...);
UIImageView object = [[UIImageView alloc] initwithFrame:SQ];
[self.view addsubview: object];
[object removeFromSuperview];
object = nil;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question