#import <notify.h>int status = notify_register_dispatch("com.apple.springboard.hasBlankedScreen",
                                          &notifyToken,                dispatch_get_main_queue(),^(int t){
                                          uint64_t state;
                                          int result = notify_get_state(notifyToken,&state);
                                          NSLog(@"lock state change = %llu", state);
                                          if(result != NOTIFY_STATUS_OK){
                                                NSLog(@"notify_get_state() not returning NOTIFY_STATUS_OK");}});
                                                if(status != NOTIFY_STATUS_OK){
                                                    NSLog(@"notify_register_dispatch() not returning NOTIFY_STATUS_OK");
                                                }
                                          }
                                 })
posted on 2013-08-15 19:50  zxgen  阅读(421)  评论(0编辑  收藏  举报