iOS 通知实现原理 - jiaxw32/iNote GitHub Wiki
有时间研究下通知实现原理,先初步整理了些资料。
#import <Foundation/Foundation-Structs.h>
@interface NSNotificationCenter : NSObject {
void* _impl;
void* _callback;
void** _pad[11];
}
+(id)defaultCenter;
+(id)_defaultCenterWithoutCreating;
-(id)init;
-(void)dealloc;
-(id)description;
-(id)debugDescription;
-(BOOL)isEmpty;
-(void)removeObserver:(id)arg1 name:(id)arg2 object:(id)arg3 ;
-(void)postNotificationName:(id)arg1 object:(id)arg2 userInfo:(id)arg3 ;
-(void)addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4 ;
-(void)postNotification:(id)arg1 ;
-(void)postNotificationName:(id)arg1 object:(id)arg2 ;
-(void)removeObserver:(id)arg1 ;
-(id)_initWithCFNotificationCenter:(CFNotificationCenterRef)arg1 ;
-(unsigned long long)_addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4 options:(unsigned long long)arg5 ;
-(void)_removeObserver:(unsigned long long)arg1 ;
-(id)addObserverForName:(id)arg1 object:(id)arg2 queue:(id)arg3 usingBlock:(/*^block*/id)arg4 ;
@end
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, November 10, 2019 at 11:07:08 PM Eastern European Standard Time
* Operating System: Version 13.1.3 (Build 17A878)
* Image Source: /System/Library/Frameworks/Foundation.framework/Foundation
* classdump-dyld is licensed under GPLv3, Copyright 漏 2013-2016 by Elias Limneos.
*/
@interface NSNotificationQueue : NSObject {
id _notificationCenter;
id _asapQueue;
id _asapObs;
id _idleQueue;
id _idleObs;
}
+(id)defaultQueue;
-(id)init;
-(void)dealloc;
-(id)initWithNotificationCenter:(id)arg1 ;
-(void)_flushNotificationQueue;
-(void)enqueueNotification:(id)arg1 postingStyle:(unsigned long long)arg2 coalesceMask:(unsigned long long)arg3 forModes:(id)arg4 ;
-(void)enqueueNotification:(id)arg1 postingStyle:(unsigned long long)arg2 ;
-(void)dequeueNotificationsMatching:(id)arg1 coalesceMask:(unsigned long long)arg2 ;
@end