I am using UIActivityIndicator in an accessory table table. This is actually a subtitle of anotherView (which is a cellView element), as shown below:
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
[anotherView addSubview:activityIndicator];
[activityIndicator startAnimating];
[activityIndicator release];
cell.accessoryView = anotherView;
In my use case, I no longer need to access the indicator view. Also, if the full view is deleted (due to the rejection of the ViewController), I don't care about these UIActivityIndicators.
So will this use be safe and not create any memory / resources? I checked that deallocfrom UIActivityIndicatorViewis being called (and it is), so I would assume that the animation would be automatically stopped / deleted and the view hierarchy would be destroyed.
Is my assumption correct?
source
share