Reputation: 575
I'm playing with particle system in iOS using CAEmitterLayer (like in this example) but i can't remove the particles when i want.
I'm trying the following code but it doesn't work:
[self.emitterLayer setLifetime:0];
[self.emitterLayer removeFromSuperlayer];
[self.setEmitterLayer:nil];
Any suggestions? Thanks!
Upvotes: 4
Views: 1208
Reputation: 53
I have played around with views a lot in the last months esp. with ios 5.0 to 6.0 and my experience is that you can't remove most these views with "removeFrom" but you can hide them and show then at will. Especially if your logic takes place within one view or without a root view.
You only have to implement something like this: to hide it: [YourView setHidden:YES];
or to show it: [YourView setHidden:NO];
Hope this helps,
R.
Upvotes: 0