I am trying to store callbacks in a dictionary.
What would be the best way to do this?
, , NSValue. NSValue .
:
[myDict setObject:[NSValue valueWithPointer:functionName] forKey:myKey];
NSValue* funcVal=(NSValue*) [myDict objectForKey:myKey]; returnType* (*func)()=[funcVal pointerValue];
NSInvocation.
NSInvocation - Objective-C , , . NSInvocation , NSTimer .
, , ?
++, .mm. , ++.
Source: https://habr.com/ru/post/1729159/More articles:Is it wrong to call the singleton method multiple times on a page in PHP? - performanceFunction syntax in Objective-C - objective-cMoving selected data from one server to another server SQL Server 2008 - sqlFailed to initialize log4j - javaCan a model observe? - javaRecommended file location that will be editable by all Windows users? - windowsHow to prevent reuse of AppDomain in IIS 7.0 when deleting a subdirectory? - asp.netAutomatically resize window contents in WPF - c #Python parallel loop - pythonHow to bind Popup (or ContextMenu) PlacementTarget to an element in UserControl? - wpfAll Articles