Is there any reason why using an NSMutableDictionary would crash NSNotificationCenter?
-
29-10-2019 - |
Frage
When posting notifications with NSNotificationCenter, is there any reason why passing in a NSMutableDictionary instead of an NSDictionary as the userInfo could cause a crash?
- (void)postNotificationName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)aUserInfo;
I'm seeing the following crash log:
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xffffffffe0000008
0 libobjc.A.dylib 0x31516fbc objc_msgSend + 16
1 Foundation 0x3195b50f __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 19
2 CoreFoundation 0x37a02577 ___CFXNotificationPost_block_invoke_0 + 71
3 CoreFoundation 0x3798e0cf _CFXNotificationPost + 1407
4 Foundation 0x318cf3fb -[NSNotificationCenter postNotificationName:object:userInfo:] + 67
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow