class methods

Discussion in 'iPhone/iPad Programming' started by bkphat, Jul 28, 2008.

  1. macrumors newbie

    Joined:
    Jun 8, 2008
    #1
    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
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    I'd say create a subclass and override the method. For example:

    Code:
    @interface CustomTiledLayer : CATiledLayer
    @end
    
    @implementation CustomTiledLayer
    + (CFTimeInterval)fadeDuration { return 0.1; }
    @end
     

Share This Page