****** XAspect Assertion Failed ******
--------------------------------------
** Condition: succeed
** Reason: **Failure: Safe category method injection failed.
**Reason: the implementation already exists.
Ture:
#import "AppDelegate.h"
#import <XAspect/XAspect.h>
#import "EMSDK.h"
#define AtAspect EM
#define AtAspectOfClass AppDelegate
@classPatchField(AppDelegate)
AspectPatch(-, void, applicationDidEnterBackground:(UIApplication *)application )
{// APP进入后台
[[EMClient sharedClient] applicationDidEnterBackground:application];
return XAMessageForward(applicationDidEnterBackground:application );
}
AspectPatch(-, void, applicationWillEnterForeground:(UIApplication *)application )
{ // APP将要从后台返回
[[EMClient sharedClient] applicationWillEnterForeground:application];
return XAMessageForward(applicationWillEnterForeground:application );
}
#undef AtAspectOfClass
#undef AtAspect
False:
#import "AppDelegate.h"
#import <XAspect/XAspect.h>
#import "EMSDK.h"
#define AtAspect EM
#define AtAspectOfClass AppDelegate
@classPatchField(AppDelegate)
// APP进入后台 - (void)applicationDidEnterBackground:(UIApplication *)application { [[EMClient sharedClient] applicationDidEnterBackground:application]; } // APP将要从后台返回 - (void)applicationWillEnterForeground:(UIApplication *)application { [[EMClient sharedClient] applicationWillEnterForeground:application]; }
#undef AtAspectOfClass
#undef AtAspect