Created
July 2, 2019 09:21
-
-
Save qy1010/4030c11e0b0611b4a0dea3dfe4e5b94b to your computer and use it in GitHub Desktop.
反射 init & invoke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//反射调用 | |
Class <#your class#> = NSClassFromString(<#your class#>); | |
id <#instance#>= [[<#your class#> alloc] init]; | |
SEL selector = NSSelectorFromString(<#CallFunc#>); | |
[<#instance#> performSelector:selector withObject:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment