Files
yuyin_ios/SweetParty/第三方库/AvoidCrash/AvoidCrash.h

117 lines
2.8 KiB
C
Raw Normal View History

2025-08-08 11:05:33 +08:00
//
// AvoidCrash.h
// https://github.com/chenfanfang/AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
//===================================================
// 使用方法和注意事项:
// https://www.jianshu.com/p/2b90aa96c0a0
//===================================================
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
//category
#import "NSObject+AvoidCrash.h"
#import "NSArray+AvoidCrash.h"
#import "NSMutableArray+AvoidCrash.h"
#import "NSDictionary+AvoidCrash.h"
#import "NSMutableDictionary+AvoidCrash.h"
#import "NSString+AvoidCrash.h"
#import "NSMutableString+AvoidCrash.h"
#import "NSAttributedString+AvoidCrash.h"
#import "NSMutableAttributedString+AvoidCrash.h"
//define
#import "AvoidCrashStubProxy.h"
@interface AvoidCrash : NSObject
//===================================================
// 使用方法和注意事项:
// https://www.jianshu.com/p/2b90aa96c0a0
//===================================================
/**
*
* .AppDelegate的didFinishLaunchingWithOptions方法中调用becomeEffective方法
* unrecognized selector sent to instance
*
* :
* [NSArray avoidCrashExchangeMethod];
* [NSMutableArray avoidCrashExchangeMethod];
* .................
* .................
*
*/
+ (void)becomeEffective;
/**
* becomeEffective
* unrecognized selector sent to instance
*
* :
* setupClassStringsArr:
* setupNoneSelClassStringPrefixsArr
* 使
*/
+ (void)makeAllEffective;
/**
* unrecognized selector sent to instance
* @"NSObject"classStrings数组中
* UI前缀的字符串加入classStrings数组中
*/
+ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
/**
* unrecognized selector sent to instance
* UI前缀的字符串(@"UI")classStringPrefixs数组中
* NS前缀的字符串(@"NS")classStringPrefixs数组中
*/
+ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
//您可以忽略以下方法
+ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo;
@end