From Apple’s Core Animation Programming Guide, listing 4:
...
// create the filter and set its default values
CIFilter *filter = [CIFilter filterWithName:@"CIBloom"];
[filter setDefaults];
[filter setValue:[NSNumber numberWithFloat:5.0] forKey:@"inputRadius"];
// name the filter so we can use the keypath to animate the inputIntensity
// attribute of the filter
[filter setName:@"pulseFilter"];
...
On the [filter setName… line I get a “No visible @interface for ‘CIFilter’ declares the selector ‘setName:’
I see that filter was created using a filterWithName initializer so I suspect that its name is read-only. But then why is this example in Apple’s code, as well as in many other example’s I’ve found?
The writeable
nameproperty is added via a category of Core Animation additions that are only present on the Mac. See the CIFilter Animatable Properties subsection:CIFilter on iOS does have a
-namemethod, but that’s only for read-only access to the filter name, and there’s no matching setter.That section of the Core Animation Programming Guide that you link to above was copied and pasted from the original Mac version of the guide, and should be altered because it doesn’t entirely apply to iOS.