SHARE
TWEET

Untitled

a guest Oct 10th, 2019 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @interface FBSystemService : NSObject
  2. +(id)sharedInstance;
  3. -(void)exitAndRelaunch:(BOOL)arg1;
  4. @end
  5.  
  6. //コード
  7. static void respring(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
  8. {
  9.     [[%c(FBSystemService) sharedInstance] exitAndRelaunch:YES];
  10. }
  11.  
  12. %ctor {
  13.    
  14. //登録
  15. CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
  16.         NULL, respring,
  17.         CFSTR("com.mikiyan1978.respring"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
  18.  
  19. }
  20.  
  21. //呼び出し
  22. CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(),
  23.     CFSTR("com.mikiyan1978.respring"), nil, nil, true);
  24.  
  25. または
  26. #import <notify.h>
  27. notify_post("com.mikiyan1978.respring");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top