CALayer w/ Animation as UIViews layer
<p>I have a UIView &amp; I want that view's layer to be a continuously looping animation but I'm having some trouble getting started. I have the following in my view subclass:</p>

<pre><code>+ (Class)layerClass {

return [CALayer class];

}
</code></pre>

<p>Then in my viewController I have:</p>

<pre><code>CAGradientLayer *gradient = [CAGradientLayer layer];
[gradient setColors:[NSArray arrayWithObjects:[UIColor redColor],[UIColor blueColor],nil]];
[[[self view] layer] addSublayer:gradient];
</code></pre>

<p>This crashes my app. What exactly am I doing wrong? The app crashes w/ EXC_BAD_ACCESS.</p>
