Latest 0.5.0
Homepage https://github.com/Dokay/DJZombieCheck
License MIT
Platforms ios 7.0
Authors

Version
License
Platform

What

A Objective-C zombie object detect tool,it can work in release mode.

中文介绍

Features

  • works in release and debug mode;
  • print param in selector that zombie object perform;

Requirements

  • Xcode 8 or higher
  • iOS 7.0 or higher

Demo

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

CocoaPods

Edit your Podfile and add DJZombieCheck:

pod 'DJZombieCheck'

Quickstart

Sample log

If DJZombieCheck detect a zombie object ,log will like this:

    DJZombieCheck_Example[16900:6214512] Find zombie,class:__NSArrayM address:0x610000059110 selector:addObject: param:(
1
)

Details

1.DJZombieCheck is Enable default,if you want to disable it,just set  DJZombieCheckEnable(global variable) to NO:
    BOOL DJZombieCheckEnable = NO;
2.Xcode Zombie Objects open also:
If Xcode Zombie Objects and DJZombieCheck are enable,DJZombieCheck will disable itself auto.

3.Want to Save crash log and send it to server:
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        //read last crash log and send it to server.

        [NSObject startZombieCheckWithType:DJZombieCheckTypeAdvance zombieBlock:^(NSString *className, NSString *selectorName, NSArray *paramList) {
            id paramLog = paramList ? paramList : @"dj_no_param";
            NSString *zombieLog = [NSString stringWithFormat:@"Find Zombie,class:%@ selector:%@ param:%@rn",className,selectorName,paramLog];
            NSLog(@"%@", zombieLog);
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Zombie Object find" message:zombieLog delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [alert show];

            //upload zombie object info and raise exception here.
            //        abort();
        }];
        return YES;
    }
4.Memory release type:
    typedef NS_ENUM(NSInteger,DJZombieCheckType){
        DJZombieCheckTypeDefault,//does not release memory for object has called release, memory usage will grow continuously.
        DJZombieCheckTypeRelease,//release memory for object has called release. if zombie object called after its memory has rewrited,zombie check may not work.
        DJZombieCheckTypeAdvance,//release object's memory when UIApplicationDidReceiveMemoryWarningNotification is post.
    };

Contact

Dokay Dou

License

DJZombieCheck is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DJZombieCheck",
    "version": "0.5.0",
    "summary": "A Objective-C zombie object detect tool.",
    "description": "A Objective-C zombie object detect tool,it can work in release mode.",
    "homepage": "https://github.com/Dokay/DJZombieCheck",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dokay": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Dokay/DJZombieCheck.git",
        "tag": "0.5.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "DJZombieCheck/Classes/**/*",
    "requires_arc": false
}

Pin It on Pinterest

Share This