Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  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");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement