Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface FBSystemService : NSObject
- +(id)sharedInstance;
- -(void)exitAndRelaunch:(BOOL)arg1;
- @end
- //コード
- static void respring(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
- {
- [[%c(FBSystemService) sharedInstance] exitAndRelaunch:YES];
- }
- %ctor {
- //登録
- CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
- NULL, respring,
- CFSTR("com.mikiyan1978.respring"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
- }
- //呼び出し
- CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(),
- CFSTR("com.mikiyan1978.respring"), nil, nil, true);
- または
- #import <notify.h>
- notify_post("com.mikiyan1978.respring");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement