You can still use the class name for the variable, but using [self class]
when allocating will make sure any subclasses are allocated properly by the
factory method.


On Wed, Apr 9, 2014 at 10:48 PM, Sendhil Panchadsaram <
notifications@github.com> wrote:

> In WordPress/Classes/WPStatsMixpanelClientInstructionsForStat.m:
>
> > @@ -0,0 +1,49 @@
> > +#import "WPStatsMixpanelClientInstructionsForStat.h"
> > +
> > +@implementation WPStatsMixpanelClientInstructionsForStat
> > +
> > +- (instancetype)init
> > +{
> > +    if (self = [super init]) {
> > +        self.disableTrackingForSelfHosted = NO;
> > +    }
> > +    return self;
> > +}
> > +
> > ++ (instancetype)initWithMixpanelEventName:(NSString *)eventName
> > +{
>
> Ahh good point. I renamed them to mixpanelInstructionsFor.... I kept the
> class name though instead of going the [self class] route to allocate the
> objects. The reason being is almost all of those methods manipulate the
> object in some way and I'm not off the top of my head aware of how to
> manipulate those objects without a warning on them (i.e. if I was to
> capture the object as an id). Besides, if we were to rename the class we'd
> be fine as the XCode refactoring tools would catch the class names being
> used in these methods.
>
> Changes are here - e190306<https://github.com/wordpress-mobile/WordPress-iOS/commit/e190306a6979ab3c2a6bf4c05a3788f3a4d7391a>
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/wordpress-mobile/WordPress-iOS/pull/1546/files#r11470773>
> .
>