PDA

View Full Version : class methods




bkphat
Jul 28, 2008, 01:59 PM
I'm working with a CATiledLayer that has a class property called fadeDuration defined as:

+ (CFTimeInterval)fadeDuration;

How do I set the value of this. I realize it's a class property due to the + sign(as opposed to an instance variable).

I tried [CATiledLayer fadeDuration] = 0;

but that doesnt do anything

thanks



kainjow
Jul 28, 2008, 03:15 PM
I'd say create a subclass and override the method. For example:

@interface CustomTiledLayer : CATiledLayer
@end

@implementation CustomTiledLayer
+ (CFTimeInterval)fadeDuration { return 0.1; }
@end