AvoidMTLModelCrash icon indicating copy to clipboard operation
AvoidMTLModelCrash copied to clipboard

How to use the category

Open chenyingsunny opened this issue 10 years ago • 3 comments

How to use the category, could you please give me an example?

chenyingsunny avatar Mar 04 '15 03:03 chenyingsunny

Just like this

#import "NSNumber+AvoidMTLModelCrash.h"
int main(int argc, char * argv[])
{
    @autoreleasepool {
       [NSNumber avoidMTLModelCrash];
       return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

Thanks for your suggestion!

ipinka avatar Mar 05 '15 02:03 ipinka

非常感谢!

chenyingsunny avatar Mar 05 '15 03:03 chenyingsunny

It's ugly to do that in main. Why not just add it to the category's +(void)load.

JasonWorking avatar Apr 16 '15 08:04 JasonWorking